Opened 19 years ago

Last modified 19 years ago

#1028 closed Bug report

ASCII mode transfer corrupts files nix=>win

Reported by: ravenm Owned by:
Priority: normal Component: FileZilla Client
Keywords: Cc: ravenm, Tim Kosse
Component version: Operating system type:
Operating system version:

Description

I have had multiple problems transferring to and from
various linux servers from XP with filezilla my current
version is 2.2.18. this problem was noted on previous
versions as well.

I have noted may other seemingly unresolved but closed
complaints about this bug.

It appears the problem relates to the file being first
saved to the server in binary mode, in other words the
crlf pair is retained.

if you then transfer the file to a windows machine in
ascii mode the file becomes corrupted.

Filezilla does not account for the crlf pair and adds
an extra cr making it crcrlf
so in hex
0D 0A
Becomes
0D 0D 0A

This has been verified.

to repeat it upload an ascii win/dos file to a nix
server in binary mode
then download it in ascii mode
open the file in a hex editor not the hex values as above

I beleive this is the main source of various complaints
about ascii mode transfers

resolution:...

filezilla should check for crlf not just cr when doing
the ascii nix=>win conversion. if there is a crlf pair
then leave as is if there is only a lf then add the cr

Change History (2)

comment:1 by Tim Kosse, 19 years ago

It is caused by your server. FTP protocol specifies, that
ascii files have to be transferred with CRLF line endings.
So FileZilla does not make any transformations if
downloading files.
It is your server that adds the extra linefeeds, since the
ascii file is not stored as ascii file on the server. You
said yourself that you uploaded it in binary mode.

Please use the same transfer mode for both upload and download.

comment:2 by ravenm, 19 years ago

I said *if* the file is uploaded in binary.

In some instances this is unavoidable. eg a file thats been
gzipped before uploading. and gunzipped on the server.

So unless you are aware of the fact it has been uploaded in
binary you may not know the cause of some strange issues.
especially when compilers/interpreters try to read the file.

I'll take it this is then an ftp server design problem. I
have seen this issue on both pureftpd and proftpd. so its
either unclear or misinterpreted as what is required.

Still from the looks of it it is the cause of many issues.

Perhaps it can be thrown over to the filezilla server design
team for consideration

Note: See TracTickets for help on using tickets.