Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Sometimes when I'm uploading a large number of small files via FTP, some of the files' contents will be replaced with FTP control messages. For example, after uploading a website I'll notice that an image isn't displaying. When I examine the image on the server, I find that its contents have been replaced with something like

Response:   125 Data connection already open; Transfer starting.
Response:   226 Transfer complete.
Status:     Directory listing successful

It's very difficult to reproduce. Any corrupted files that I notice, I can usually just retransfer them. If I retransfer the whole site, maybe different files will be corrupted, maybe none at all.

This problem has been plaguing me for several years, and in that time I've replaced my computer (twice), my router, my cable modem, and I've moved halfway accross the country. I haven't had the problem recently, but that's probably only because I've learned ways of avoiding it, like zipping everything up before transferring it. I use FileZilla, by the way.

I discribed the problem to one of my web hosts once. They'd never heard of anything like it, didn't have a clue. I would love to know what's been going on. As it is, I'm very leery about using FTP for anything more than a handful of files.

share|improve this question
1  
FTP is not a reliable protocol, but I'd suggest trying another client since you don't mention trying that. Or another server. The file being replaced sounds like a nasty bug. –  gparent May 8 '12 at 16:24
    
Do you have the problem across multiple web hosts? –  Jeremy May 8 '12 at 16:38
    
@Jeremy I'm honestly not sure because the problem is so sporadic and difficult to detect, but I think I've had the problem with at least two different hosts: a small company in Ohio and HostGator. –  Metaphile May 8 '12 at 16:59
    
Can you be more specific about the "large number"? Is it greater than, say, 32k or 64k? –  Gerald Combs May 8 '12 at 17:10
1  
As you've asked for theories, rather than technical explanations, I'm going to go with the possibility that aliens have intercepted the transmission and modified it as a first step to breaking our communications systems. –  John Gardeniers May 8 '12 at 23:51
show 3 more comments

4 Answers

Very simply: the universe (and/or Murphy) is punishing you for continuing to use a thoroughly obsolete and insecure protocol like FTP.

When you connect to your web server using FTP, your username and password are sent unencrypted, in the clear, for everyone and Big Brother to read. So are the contents of all the files that you upload or download using FTP. For security reasons alone, I would strongly suggest switching to SFTP, which is a built-in feature of SSH. Any web hosting provider worth your business supports SSH and SFTP.

Any FTP problems that you may be experiencing on the server side almost certainly will not apply when using SFTP, because SFTP connections are handled by a completely separate daemon/service on the server.

Unlike FTPS, FTPES, etc., SSH/SFTP implementations are very consistently interoperable. You are unlikely to experience strange and unpredictable problems when transferring files via SFTP.

share|improve this answer
    
You're so right. :D –  Metaphile May 8 '12 at 17:47
    
I completely agree with your answer, but I think it is a little misleading to start off by blaming "unencrypted FTP", as the issue isn't the lack of encryption, but the fact that FTP as a protocol is very flaky. No downvote or anything, but it might be worth revising as many people don't read beyond the first line :) –  Jeremy May 8 '12 at 21:57
    
@Jeremy Updated for clarity. –  Skyhawk May 8 '12 at 22:06
add comment

My money is on a FTP server bug (your host's problem). Make sure you are using the latest version of FileZilla, and configure it to log all your FTP sessions so that if you discover this corruption, you can provide the host with a log of the session. It might help them troubleshoot.

If you have shell access to your host, you could use SCP instead.

share|improve this answer
add comment

just to be on safe side, I'd make sure transfer set to "binary" sometimes it transfer files in ASCII mode and that's where you usually get so to speak corruption, so try that if that doesn't solve your problem then I'd look into replacing/updating your server & client and if that doesn't help either then look on interface if you're getting errors there...

share|improve this answer
add comment

for me this was because of the transfer mode set to ASCII in filezilla, i set Transfer -> Transfer type -> Auto, (to ensure it uses binary mode when required)

this solved my issue. Hope this helps you guys as well.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.