Upload Changes html Text File Jumpline

Come here to discuss FileZilla and FTP in general

Moderator: Project members

Post Reply
Message
Author
cemx86
500 Command not understood
Posts: 3
Joined: 2023-11-12 22:13
First name: john
Last name: DeRosa

Upload Changes html Text File Jumpline

#1 Post by cemx86 » 2023-11-12 22:24

I am fighting a problem with FileZ that has recently started to occur.

I have a flat (html) file with 100's of lines of code which I manually FTP upload via FileZ.

If I then download the same file it has changed into one very long line of code as if any CRs or LFs have been removed.

Am I doing something wrong in the file transfer? A setting in FileZ? An issue with the web site host (Jumpline)?

Thanks, John

cemx86
500 Command not understood
Posts: 3
Joined: 2023-11-12 22:13
First name: john
Last name: DeRosa

Re: Upload Changes html Text File Jumpline

#2 Post by cemx86 » 2023-11-12 22:33

I seem to have fixed this by changing the default FTP transfer type (Transfer > Transfer Type) from text to binary.

This makes no sense to me as this is a pure text flat file.

Why would an FTP text transfer remove CRs or LFs but binary doesn't?

Expiring minds want to know.

Thanks, John

User avatar
boco
Contributor
Posts: 26940
Joined: 2006-05-01 03:28
Location: Germany

Re: Upload Changes html Text File Jumpline

#3 Post by boco » 2023-11-13 00:21

Your target server is most probably one based on any sort of UNIX, Linux or similar. The HTML file is technically a file containing plain text, so, the Auto setting will upload it as ASCII (TYPE A) file. Internally, FTP uses a CR+LF line ending scheme, like Windows. So, the server is supposed to convert line endings from CR+LF to LF only, when receiving the file with TYPE A. And, it is supposed to convert the file back to CR+LF line endings when sending it to clients using TYPE A.

If the server's conversion feature is broken either on upload or download, you will get that mess. Is the file really without any line endings, or does it contain at least the LFs and your local editor is just unable to display them correctly?

Using binary or Image type (TYPE I) to transfer the file disables the conversion completely, however, you could get problems if some software on the server cannot read CR+LF line endings correctly.
No support requests over PM! You will NOT get any reply!!!
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org

cemx86
500 Command not understood
Posts: 3
Joined: 2023-11-12 22:13
First name: john
Last name: DeRosa

Re: Upload Changes html Text File Jumpline

#4 Post by cemx86 » 2023-11-13 22:04

Thanks for your comments.

I inspected a "broken" file and there are no CRs or LFs in it.

I tried all three settings automatic, text and binary. Only binary works.

Note that if I change the extension to .txt the same problem occurs.

Thanks again.

User avatar
boco
Contributor
Posts: 26940
Joined: 2006-05-01 03:28
Location: Germany

Re: Upload Changes html Text File Jumpline

#5 Post by boco » 2023-11-13 23:54

FTP never look into files, so, the ASCII vs. binary file is solely decided on the file extension. Both .html and .txt are on FileZilla's list of text file extensions, they are the same in this regard.

What line endings has the original file? In any way, if the result has no line endings whatsoever and is only "spaghetti code", there's clearly a bug with the server's conversion feature and you should use only Binary to transfer to that server. Most *nix software can read Windows line endings now.
No support requests over PM! You will NOT get any reply!!!
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org

Post Reply