How can I stop Filezilla changing my linebreaks?

匿名 (未验证) 提交于 2019-12-03 02:00:02

问题:

I'm downloading a perl CGI file from a Linux web server.

It has Unix linebreaks. I edit it on a Windows PC with a decent text-editor (Geany) which preserves those linebreaks.

I then upload it again with Filezilla and it has DOS linebreaks, which stop it working.

I know it's Filezilla, not Geany because even if I just download it, and re-upload it, the problem recurs.

Filezilla asks me, every time, if I'm OK to upload the local file (3611) bytes and overwrite the remote file (3753 bytes), and the difference between those numbers is the number of lines in my file. But when I do that, the one on the server is 3753 bytes all over again and doesn't work.

I'm going through a proxy server, might that be a factor? The really weird thing is I did the same thing on a different XP PC just the other day and it was fine. And command-line FTP works fine too.

回答1:

In FileZilla 2.2.32, go Edit > Settings > File transfer settings > ASCII/Binary. Set it to always binary: that should do the trick.

In FileZilla 3.5.0 the setting is in Edit > Settings > Transfers > File Types > Default transfer type > Binary.



回答2:

What FTP transfer mode do you use (binary or ASCII?)? I'm not 100% sure, but I think if you force binary mode you should not have this problem.



回答3:

The developers of FileZilla appear to have a pretty exclusive opinion on how unknown files should be transferred by default.

The bug report dwells since 2008. Of course, it may help if more people jump in and request a fix for this flaw.



回答4:

The actual problem was with Filezilla FTP client default transfer mode, by default it is "Auto". Follow below step to convert it into "binary".

Go to the "Edit | Settings… "

In the new window, go to "transfers | File Types " and in "Default transfer type", select "Binary".



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!