0

I have unix executable files along with a mac OS X app that I have transferred to my FTP server. When I download these files after uploading them, the unix executables download as TextEdit documents. Like wise with the Application, when downloaded it says "The application MyApp cannot be opened". I believe this is because when it downloads the app it downloads the unix executable in the directory MyApp/Contents/MacOS/Myapp as a text document. So I assume the issue is the same with both problems I am having. How can this be fixed. Also I would also like to have the same custom icon that I uploaded the file with. Note: The check sum for the original file and the downloaded file from the ftp server are the same.

1 Answer 1

-1

TLDR:

This is normal when you download in ASCII mode. Switch to binary download

Background:

Back in ye days of lore when we only had english on computers and no accent, trema's or other interesting characters and when memor was still very scarce we use ASCII to represent letters and number. ASCSII contains 127 entries.

127 entries fitr in 7 bits, while a current regular byte is 8 bits.*1

If you send over all 8 bits then you are wasting (then very expensive and limited) bandwidth*2, so the 8 bit got dropped. This worked fine for text files. If you tranfered binary (non_ASCII) data then you needed to explicitly tell FTP to download all 8 bits by switching to binary mode.


*1: As well as doing helpful things like converting your text between remote format to local. E.g. from mainframe EBDIC to ASCII, changing line ending between etc.

*2: Bandwidth example:

ASCII mode:

AAAAAAAB BBBBBBCC CCCCCDDD DDDDEEEE EEEFFFFF FFFGGGGG GGHHHHHH H...   
                                                        ^^^^^^
                                                        Savings

Binary mode:

AAAAAAA- BBBBBBB- CCCCCCC- DDDDDDD- EEEEEEE- FFFFFFF- GGGGGGG- H....
8
  • Thanks @Hennes for your comment but I am still having this problem. Once I connect to my ftp server it says 'Using binary mode to transfer files.' . Even so I type binary and it says '200 TYPE is now 8-bit binary' and I upload the file and try to download it and I still have the same problem
    – J.Doe
    Feb 3, 2016 at 8:37
  • Now that is weird. Csan you checksum it (e.g. MD5 it) and see it it fail on both binary upload and binary download? ).
    – Hennes
    Feb 3, 2016 at 8:38
  • The check sum for the original file and the downloaded file from the ftp server are the same
    – J.Doe
    Feb 3, 2016 at 8:44
  • Hmm, than I was wrong. It is not getting corrupted due to wrong FTP settings. I'll delete the wrong answer in a bit. Meanwhile Please use the edit link to add this information to the original post. Also make test (and add to the OP that you tested) an upload to make sure that the files on the server are fine (so we know we do not have this BINARY (fine) -> Upload (Binary, corrupted). followed by (Binary, corrupted, MD5 taken). -> Download (still same corruption).
    – Hennes
    Feb 3, 2016 at 8:45
  • I've edited the question but I don't understand the second part of your comment.
    – J.Doe
    Feb 3, 2016 at 8:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .