Apple DMG files via FTP getting corrupted why?

I am trying to FTP some DMG files in apples, if we do it manually via Safari or IE it gets to the destination just fine and not corrupted. However, if I am using a free FTP client that we have used with great success for zip and exe, or if I am using a Powershell script I am done (adapted from another question on the stacker stream answer) then I lose about 1/2 Mb in a 10.5 Mb file, and the dmg is corrupted. Anyone have any problem what could go wrong? What can I do to prevent this? So far all I have tried is gzipping dmg before submitting and it has brought nothing. Again, nothing but dmg gets passed just fine.

FYI I am using binary mode transfers, so they are not. Although though

0


source to share


3 answers


Everyone just knows. The client I was using must have had the same problem as my PowerShell script. I used a StreamReader to get the bytes to transfer and assumed the encoding was wrong. I switched to BinaryReader which is not there and now it works.



0


source


It looks like your client is treating the dmg file as a text file. set the binary transfer mode in your ftp client and it will ftp as it is.



I always thought that ftp's ascii transfer mode was just silly. This is causing more problems than it is worth.

+1


source


Are you sure everything except DMG is being transmitted correctly? This sounds like a transmission encoding problem. FTP supports both binary and ASCII transfer types, mainly due to the historical baggage. In the old days, when bandwidth was lower, leaving the bit high (which ASCII doesn't use) was a good time saver. However, if you have any bytes with the bit set, the ASCII transfer mode will lose them - hence the "binary" mode, which truncates nothing.

As a rule, the command for switching transmission modes is "bin" or "ascii".

+1


source







All Articles