Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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.

share|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. –  David Dai Nov 3 '12 at 16:15

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.