Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Filezilla removes line breaks on php files [duplicate]

Tags:

filezilla

ftp

Possible Duplicate:
How can I stop Filezilla changing my linebreaks?

For some reason Filezilla sometimes removes line breaks on my php files making the code appear on a single line giving me a bunch of errors when I upload my projects, I was looking around and changed my transfer type to Binary but I still have the same issues, downloaded CuteFTP as well but same problem.

Does anyone know what can I do to fix this?

Thanks in advance!

EDIT: Now that I check, when I upload the files to my hosting they look in one line as well, but it doesn't give me any errors, the problem is when I upload to my clients host, could it be some configuration on the hosting or something?

like image 658
Javier Villanueva Avatar asked Dec 28 '10 16:12

Javier Villanueva


People also ask

How to remove line break from string in PHP?

The line break can be removed from string by using str_replace() function.The str_replace() function is an inbuilt function in PHP which is used to replace all the occurrences of the search string or array of search strings by replacement string or array of replacement strings in the given string or array respectively.

Does trim remove all line breaks in HTML?

Yes, take note, trim () leaves all line breaks in-between as-it-is. Lastly, this should be pretty self-explanatory. To remove HTML line breaks ( <br> or <br/> ), we do the same old “replace all <br><br/> with an empty string”.

How do I remove the leading and trailing line breaks in Python?

To only remove the leading and trailing line breaks, use the trim () function instead. Yes, take note, trim () leaves all line breaks in-between as-it-is. Lastly, this should be pretty self-explanatory.

Should FileZilla transfer unknown files by default?

The developers of FileZilla appear to have a pretty exclusive opinion on how unknown files should be transferred by default. The bug report dwells since 2008. Of course, it may help if more people jump in and request a fix for this flaw.


2 Answers

change the "Transfer" to "Binary" (Do not keep it as a "Auto"). Restart Filezilla and upload files as it is.

like image 135
Hemant Jadhav - web developer Avatar answered Nov 13 '22 17:11

Hemant Jadhav - web developer


Well, I managed to solve my problem, I dont exactly know how I just deleted the folder, uploaded as ASCII again, changed to Binari, restarted Filezilla, deleted the files again, and re-upload it as Binari again. For some reason it works now, maybe you have to restart Filezilla to apply the changes correctly.

like image 23
Javier Villanueva Avatar answered Nov 13 '22 18:11

Javier Villanueva