Cpanel – FileZilla FTP – All code converted in single line

Author posted by Jitendra on Posted on under category Categories Web Technology and tagged as Tags , , with Leave a comment on Cpanel – FileZilla FTP – All code converted in single line

While transferring the php, html or javascript file using filezilla ftp client to the cpanel – all the codes converted into single line

Problem detail :

I used the FileZilla FTP client to transfer the source code in cpanel environment. I normally use the Notepad++ editor to edit the code. While transferring the code from local to cpanel using filezilla – sourcecode of PHP, HTML, Java Script … all the code converted to the single line.

Lets discuss in detail , if my code is like :

<?php
 if(isset($_POST['YourName']))
 {
   //Check Name have special character or not
   $isValid = true;
 }
?>

then it gets converted to

<?php if(isset($_POST['YourName'])) {   //Check Name have special character or not $isValid = true; } ?>


As you can see now, what problem arises ? As i am using the single line comment “//” all the code after that becomes comment and there is syntax as well as logical error.
Actual problem was with Filezilla FTP client default transfer mode, by default it is “Auto”. Follow below step to convert it into “binary“.
Go to the “Edit | Settings…

FileZilla Settings
FileZilla Settings

In new window, go to “transfers | File Types ” and in “Default transfer type”, select “Binary“.

FileZilla Default Transfer type
FileZilla Default Transfer type

Related posts