0

I have a unique problem where no endline's are saved to my javascript and php files after editing them.

I have downloaded my websites javascript and php files using ftp so I can edit them. I have edited them in Notepad++ then reuploaded them. And everything broke because all the new code I added have no endlines in them, just one long line, so some lines have a comment in them and it is causing syntax errors.

What could cause such a weird problem?

Important Informatiom:

  • The existing code in the edited files have correct endlines/formatting. Its just the new code/text that is added.
  • Each of the files are UTF8 encoded without a BOM. I didn't set this encoding, thats how they came from filezilla.
  • I am on Windows 8.1
  • Inside Notepad++ the file looks fine, with endlines and correct formatting. When I view the files in Chrome's source browser (for eg; the javascript file) it shows that all the new code is on one line without any newlines (the original code has all its newlines weirdly).
  • If i search the editted files for the character /n in Notepad++ it only finds endline chars on the existing code lines but not on my new code, even though that new code is shown on different lines. Such a weird problem.
sazr
  • 24,984
  • 66
  • 194
  • 362
  • If you re-download the files after editing them are the newlines gone? Is it possible that your webserver is processing the files through some sort of minimizer module? – But those new buttons though.. Apr 04 '15 at 10:21
  • try [this](http://superuser.com/questions/39520/downloading-files-with-filezilla-result-in-newline-r-n-n) so tell your client to handle all files as binary so it won't mess with them – Eugene Glova Apr 04 '15 at 10:27

1 Answers1

0

Use this answer How can I stop Filezilla changing my linebreaks?

In FileZilla 2.2.32, go Edit > Settings > File transfer settings > ASCII/Binary. Set it to always binary: that should do the trick.

In FileZilla 3.5.0 the setting is in Edit > Settings > Transfers > File Types > Default transfer type > Binary.

Community
  • 1
  • 1
Eugene Glova
  • 1,543
  • 1
  • 9
  • 12