I have a Windows 7 host and an Ubuntu virtual machine; the VM has a bridged adapter.

I created a .tar file in Ubuntu using this command:

tar -cf name.tar /path/to/dir/

I have FileZilla FTP server running on my host, so I used the ftp command to send the file to my Windows machine. But I cannot open it in Windows; 7z reports

cannot open name.tar as archive

Then I tried copy the file using HTTP, which turned out fine. Why is the file currupted by FTP?


Force your FTP client to use BINARY file transfer mode - this should be possible to set somewhere in settings.

As background: there are two modes of file transfer - text and binary, if binary is used, data are transferred as is, if you use text, it tries to translate ends of lines to the target platform. In your case the latter happens and damages your archive.

| improve this answer | |
  • Most likely this is the reason. Wouldn't hurt to checksum the file before and after transfer, if the checksums will not match - a binary diff could be used to show the differences (this may confirm the stated assumption). – AnonymousLurker Nov 3 '12 at 9:34
  • The command to set it somewhere in your setting is by typing bin after you opened the FTP connection to the other host. – Hennes Nov 3 '12 at 15:22
  • binary tranfer mode solves the problem. Thanks, guys. – SparedWhisle Nov 3 '12 at 16:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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