•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 391,596 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,706 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 1226 | Replies: 5
![]() |
•
•
Join Date: Jun 2004
Posts: 604
Reputation:
Rep Power: 6
Solved Threads: 6
HI everyone,
Let's say when i connect to a ftp do i have to worry about something called type.
I mean for example let say when connect to an ftp as such
Do i have to worry about something called type as such
Does the first way i list above work or do i have to use the second way i listed with the type for the connection to be successful.
Which of the above two ways you have used and which do you find more effective or are both the same.
If i do not specify the type by using the first way is there a default?
If i have to use the one with the type what the different kinds of types are there?
Currently i only know two which are i = image and a = ascii
Any help is greatly appreciated
Thank You
Yours Sincerely
Richard West
Let's say when i connect to a ftp do i have to worry about something called type.
I mean for example let say when connect to an ftp as such
URL url = new URL("ftp://user:pass@ftp.fileplanet.com/polo.zip");Do i have to worry about something called type as such
URL url = new URL("ftp://user:pass@ftp.fileplanet.com/polo.zip;type=i");Does the first way i list above work or do i have to use the second way i listed with the type for the connection to be successful.
Which of the above two ways you have used and which do you find more effective or are both the same.
If i do not specify the type by using the first way is there a default?
If i have to use the one with the type what the different kinds of types are there?
Currently i only know two which are i = image and a = ascii
Any help is greatly appreciated
Thank You
Yours Sincerely
Richard West
Microsoft uses "One World, One Web, One Program" as a slogan.
Doesn’t that sound like "Ein Volk, Ein Reich, Ein Führer" to you, too?
— Eric S. Raymond
Tell me what type of software do you like and what would you pay for it
http://www.daniweb.com/techtalkforums/thread19660.html
Doesn’t that sound like "Ein Volk, Ein Reich, Ein Führer" to you, too?
— Eric S. Raymond
Tell me what type of software do you like and what would you pay for it
http://www.daniweb.com/techtalkforums/thread19660.html
•
•
Join Date: Nov 2004
Location: Netherlands
Posts: 5,646
Reputation:
Rep Power: 18
Solved Threads: 191
Depending on the server (whether it defaults to text mode, binary mode, or autodetects which is needed) the first may return a corrupted file.
You will get a connection in either case, but unless the data you are retrieving is text only not adding the 'i' flag may result in corruption as most ftp servers will transfer in text mode unless told otherwise.
You will get a connection in either case, but unless the data you are retrieving is text only not adding the 'i' flag may result in corruption as most ftp servers will transfer in text mode unless told otherwise.
42 Private messages asking for help will be ignored
In the frozen land of Nador they were forced to eat Steve's iMinstrels, and there was much rejoicing.
In the frozen land of Nador they were forced to eat Steve's iMinstrels, and there was much rejoicing.
•
•
Join Date: Jun 2004
Posts: 604
Reputation:
Rep Power: 6
Solved Threads: 6
Hi everyone,
Sorry to ask this but what does a html file classify under the ftp protocol. image or ascii?
Richard West
Sorry to ask this but what does a html file classify under the ftp protocol. image or ascii?
Richard West
Microsoft uses "One World, One Web, One Program" as a slogan.
Doesn’t that sound like "Ein Volk, Ein Reich, Ein Führer" to you, too?
— Eric S. Raymond
Tell me what type of software do you like and what would you pay for it
http://www.daniweb.com/techtalkforums/thread19660.html
Doesn’t that sound like "Ein Volk, Ein Reich, Ein Führer" to you, too?
— Eric S. Raymond
Tell me what type of software do you like and what would you pay for it
http://www.daniweb.com/techtalkforums/thread19660.html
•
•
Join Date: Nov 2004
Location: Netherlands
Posts: 5,646
Reputation:
Rep Power: 18
Solved Threads: 191
the html file itself is plain text. What protocol you use to retrieve it doesn't change that.
Of course any graphics and plugins (applets, flash, etc.) linked to for embedded display will be typically binary (though you can embed plain text as well).
Linked JS and CSS are text as well.
Of course any graphics and plugins (applets, flash, etc.) linked to for embedded display will be typically binary (though you can embed plain text as well).
Linked JS and CSS are text as well.
42 Private messages asking for help will be ignored
In the frozen land of Nador they were forced to eat Steve's iMinstrels, and there was much rejoicing.
In the frozen land of Nador they were forced to eat Steve's iMinstrels, and there was much rejoicing.
•
•
Join Date: Jun 2004
Posts: 604
Reputation:
Rep Power: 6
Solved Threads: 6
Hi everyone,
I could use binary to read a text file as well and from what i know that would not corrupt the file as long as i read all the bytes correctly back to my HD. Esentially its only a file. Like copying from place to another
I mean assuming there was a html file on the other side of the server and got its outputstream and i used the FIleOutputStream and read the html file back to HD. That would work as well would it not.
Correct me if i am wrong
Richard West
****************************************************
•
•
•
•
Originally Posted by jwenting
the html file itself is plain text
I could use binary to read a text file as well and from what i know that would not corrupt the file as long as i read all the bytes correctly back to my HD. Esentially its only a file. Like copying from place to another
I mean assuming there was a html file on the other side of the server and got its outputstream and i used the FIleOutputStream and read the html file back to HD. That would work as well would it not.
Correct me if i am wrong
Richard West
****************************************************
Microsoft uses "One World, One Web, One Program" as a slogan.
Doesn’t that sound like "Ein Volk, Ein Reich, Ein Führer" to you, too?
— Eric S. Raymond
Tell me what type of software do you like and what would you pay for it
http://www.daniweb.com/techtalkforums/thread19660.html
Doesn’t that sound like "Ein Volk, Ein Reich, Ein Führer" to you, too?
— Eric S. Raymond
Tell me what type of software do you like and what would you pay for it
http://www.daniweb.com/techtalkforums/thread19660.html
•
•
Join Date: Nov 2004
Location: Netherlands
Posts: 5,646
Reputation:
Rep Power: 18
Solved Threads: 191
Of course. You can read a text file in binary mode without it getting corrupted, but not vice versa.
Not quite sure, but I think binary mode adds a layer of encoding to the transfer to ensure no data is lost (this is transparent).
FTP was originally created to transport only text data, and if I'm not mistaken uses 7 bits per byte (discarding one) just like SMTP.
Therefore binary data needs to be encoded from 8 down to 7 bits before being sent over the line.
Text data already fits in 7 bits (unless it's UTF-8 for exampl with the high bits in use, for example Chinese) and therefore needs no special treatment.
Not quite sure, but I think binary mode adds a layer of encoding to the transfer to ensure no data is lost (this is transparent).
FTP was originally created to transport only text data, and if I'm not mistaken uses 7 bits per byte (discarding one) just like SMTP.
Therefore binary data needs to be encoded from 8 down to 7 bits before being sent over the line.
Text data already fits in 7 bits (unless it's UTF-8 for exampl with the high bits in use, for example Chinese) and therefore needs no special treatment.
42 Private messages asking for help will be ignored
In the frozen land of Nador they were forced to eat Steve's iMinstrels, and there was much rejoicing.
In the frozen land of Nador they were forced to eat Steve's iMinstrels, and there was much rejoicing.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
- HELP WITH FTP, PLEASE: (Visual Basic 4 / 5 / 6)
- Tek's FTP (Networking Hardware Configuration)
- FTP files (Geeks' Lounge)
Other Threads in the Java Forum
- Previous Thread: need help asap :)
- Next Thread: Special Character generation



Linear Mode