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 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
4  
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
1  
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
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.