December 22, 2005

FileZilla ASCII and line endings

I've tried my small share of FTP programs, among them Filezilla. Thing is, I like to upload in secure mode (e.g., SFTP) when at all possible. And, while I loved Filezilla's ability to upload files utilizing PuTTY (that is, securely), I also noticed a problem when uploading .cgi scripts — namely, Perl scripts would stop working. Which you wouldn't necessarily notice for a while. :(

I finally discovered that, in secure mode, Filezilla was adding line endings to the lines of code, thereby rendering them invalid. I discovered this by SSHing in (with Putty) and editing the files via VI. This is what I saw:

line of code^M
line of code^M

… ad infinitum. While one *could* edit the files with VI to remove the line endings, that's hardly a convenient solution; no, uploading and being done with it is the convenient solution in my book.

I'd seen this seeming solution at Ringlink.org:

Personally I have just noticed that sometimes "ASCII transfer mode" does not work, and my own 'solution' is to ensure with my text editor that the files are saved in Unix mode *before* the transfer to the Unix environment.

This is in my opinion too much hassle. Text editors (I use NoteTab Pro) normally save in non-Windows no-line-endings mode; it's Filezilla in secure mode that was adding them. Upload a file in Filezilla — line endings. Upload the same unchanged file in a normal FTP program — no line endings. End of story.

Actually, the real end of the story is that I had switched from WS_FTP Pro because it had the same line-endings problems when uploading in secure mode. However, the latest versions do not. That's the end of the story, or at least, my story. :)

Added: Excellent series of pages from Indiana University regarding FTP and Mac and UNIX line endings

~ Diane Vigil

Have your say ...

If this is your first comment, it will be held for moderation (but comments are appreciated). Otherwise, just be courteous, don't drop links unless highly pertinent — and no substituting keywords for your name. Posters must be 16 or older. We use Akismet, so if you don't see your non-spam comment posted, contact me.

Note: unless you're sure of your math answer,
copy your comment [Cntrl A, Cntrl C] before you click submit ...

Manage your subscriptions

Archives
© 2004-2008 DianeV. Web Design Studio - Los Angeles. All Rights Reserved.
27 queries. 0.171 seconds.