Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am building a website for my employer, and for the past few days uploading files has been a real nuisance.

For example, I upload a .php file from my local drive to the server. When loaded in a web browser, the file doesn't render correctly as it did on my local server, so I check the contents of the .php file and notice that many of the lines of code were converted to a single line. Upon inspection, I see that newline characters in parts of the .php file have been removed, but newlines in other parts of the file are intact. A single commented-out line ends up disabling a large chunk of code, rendering it corrupted.

It seems as though the server is trying to compact the data to conserve space when the file is uploaded. Does anyone know what would be causing this, and maybe how to fix it?

Also to note: my web host (HostMonster) just migrated our site to a new server a few days ago.

share|improve this question
The file was uploaded as text instead of binary. Some character in the text triggered some mode in the upload protocol where it figured it could eliminate newlines. – Daniel R Hicks Oct 17 '12 at 23:55
If you're uploading using FTP, figure out how to set your client to binary mode. – David Schwartz Oct 18 '12 at 0:02
when copying between windows and unix/linux sometimes the line endings are not translated correctly during ftp. – Ben West Oct 18 '12 at 5:38

Your Answer


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

Browse other questions tagged or ask your own question.