Search code examples
phpdownloadeditingfilezilla

Issue with php file while downloading from server using filezilla


i have created a php page(properly indented) having more than 1000 lines in notepad++ and uploaded to the server via FileZilla, the code works fine in server, but when i downloaded the code for editing it shows the whole lines made together to one line and looks tedious to edit the desired code. Any help is really appreciable.


Solution

  • Somewhere along the way the Windows newline characters (carriage return + line feed) are likely getting converted to Unix style (line feed). You can convert them back by using something like unix2dos. You can read more about how different operating systems handle new lines on Wikipedia.

    Doing a bit more research shows that if you upload and download the files using binary format with FileZilla, it won't do the conversion. So either use binary when uploading to retain the Windows format or turn it off for downloading back to your computer to make it convert the Unix newlines to Windows. See the Filezilla Wiki