Cpanel – FileZilla FTP – All code converted in 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

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.