• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

FTP

 
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

[ EJFH: Disabled smilies ]
[ October 16, 2005: Message edited by: Ernest Friedman-Hill ]
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would guess that the two types would be ascii and binary, but I don't know whether or not you need to put that in the url. I don't remember every including that in the url.

If you try to ftp a binary file in ascii, you'll get garbage. On the other hand, binary mode seems to always work.
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As Marilyn says, most FTP clients differentiate between two types of files: binary and ASCII. I don't think this type is included in the URL. Not only will a binary file treated as ASCII result in garbage. The file will be damaged. This is because each operating system has its own representation for an end of line sequence. I think the main reason that FTP clients worry about the "file type" is to deal with these differences and translate the "end of line sequence" from that used in the server's OS to that used in the client OS. This means that binary data will be modified if it is treated as ASCII text.

If you want/need this feature in the FTP client you are developing, then I think you will need to add your own logic to look at the data and convert EOLs as necessary. (As a disclaimer, the FTP protocol might have this built-in, but I'm unfamiliar with the specifics of the protocol to give a definite answer.)

Layne
[ October 16, 2005: Message edited by: Layne Lund ]
 
Richard West
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,

Sorry to ask this but what does a html file classify under the ftp protocol. image or ascii?

Richard West
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HTML files should be transferred using FTP in ascii mode.

However, if the HTML file contains Unicode characters, it should be transferred in binary (image) mode.
[ October 16, 2005: Message edited by: Barry Gaunt ]
 
He was giving me directions and I was powerless to resist. I cannot resist this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic