开发者

Files are getting corrupted via FTP Client Upload

I tried uploading files to my server

my.php (normal local file)

<?php
$box_title= "SEARCH ME"
?>

After uploading via FileZilla FTP C开发者_如何学Golient (remote server file)

// SOMETIMES ABOVE FILE BECOMES
<?php$box_title= "SEARCH ME"?>

// OR SOMETIMES LIKE THIS
<?php

$box_title= "SEARCH ME"

?>

I suspect this is a server related issue, but not sure. Can anyone explain this problem with solution

Thanks


An above comment already suggested looking at ASCII/binary mode. It's a weird property of FTP that files can be treated as ASCII text (in which case the FTP transmission will automatically change the encoding of line endings to fit the one used by the target machine) or binary (in which case they'll be transferred without any changes).

The mutilation you quoted in your question is probably not half as bad as it looks; some editors actually do not display UNIX-style line ending encoding (which is what FTP in ASCII mode probably put into your files) even though it's there.

The different encodings for line endings are a constant source of grief in portable computing stuff... in this case the best thing I can recommend is for you to try out if it works the way you do it now, and if it doesn't, try forcing your FTP client's transfer mode to a different setting.


I would like to at my $0.02 to this.

As Jan suggested, this is definitely an ASCII transfer issue.

However, I think this is not appropriate or expected behavior from the FileZilla cllient.

I am transferring Perl files from a Debian Linux client to a Debian Linux Server over SFTP (SSH).

FileZilla is set to transfer files with a .pl extension in ASCII mode, but this produces the incorrect format that Ish Kumar noted in the original question.

Text files transferred in ASCII mode should transfer just as well from *nix to *nix as they do from Windows to *nix.

I blame Filezilla for this one.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜