 |
 | uploaded files have extra newlines |  |
 |
 | |  |
 |
 | |  |
Joined: 26 Jan 2009 |
Posts: 12 |
|
|
 |
Posted: Sun Mar 29, 2009 3:50 pm |
|
 |
 |
 |
 |
dmitri wrote: | It was discussed many times there.
I'd highly recommend to select binary transfer mode in the account settings. |
I can't find in PHPed 5.5 where I can enable binary/ASCII transfer mode. Searching the help files produced nothing. There's no options in the account settings.
I did some packet capturing on PHPed's FTP client, and it looks like it sets the mode to Binary (I) mode for transfers, which skips win/unix CRLF conversion at the FTP server, but I guess it would depend on the server. Both of the FTP clients I tested (winSCP, Filezilla) transferred the same file to the same server as ASCII.
There should really be a way to force PhpED to use ASCII mode... is there?
--- PhpED 5.5.5519 ---
USER [removed]
331 User [removed] OK. Password required
PASS [removed]
230-User [removed] has group access to: [removed]
230 OK. Current restricted directory is /
TYPE I
200 TYPE is now 8-bit binary
SYST
215 UNIX Type: L8
PWD
257 "/" is your current location
CWD /public_html/
250 OK. Current directory is /public_html
PWD
257 "/public_html" is your current location
PWD
257 "/public_html" is your current location
CWD /public_html/[removed]/
250 OK. Current directory is /public_html/[removed]
CWD /public_html
250 OK. Current directory is /public_html
PORT 192,168,0,117,8,65
200 PORT command successful
STOR /public_html/[removed]/__test.php
150 Connecting to port 37827
226-File successfully transferred
226 0.066 seconds (measured here), 38.52 Kbytes per second
--- WinSCP 4.1.3 ---
TYPE A
200 TYPE is now ASCII
PORT 192,168,0,117,8,56
200 PORT command successful
STOR __test.php
150 Connecting to port 37744
226-File successfully transferred
226 0.051 seconds (measured here), 48.68 Kbytes per second
TYPE A
200 TYPE is now ASCII
PORT 192,168,0,117,8,57
200 PORT command successful
LIST -a
150 Connecting to port 37745
226-Options: -a -l 226 38 matches total
--- Filezilla 3.2.2 ---
TYPE A
200 TYPE is now ASCII
PORT 192,168,0,117,14,187
200 PORT command successful
STOR __test.php
150 Connecting to port 44690
226-File successfully transferred
226 0.026 seconds (measured here), 94.28 Kbytes per second
|
|
|
 |
 | |  |
Joined: 26 Jan 2009 |
Posts: 12 |
|
|
 |
Posted: Mon Apr 06, 2009 11:58 am |
|
 |
 |
 |
 |
That is a non-solution. I work with lots of different FTP servers and am not able to change settings on them much less install different FTP daemons.
ASCII is the default transfer mode as required by RFC 959 (3.1.1.1). The ASCII transfer mode converts Windows' CRLF to UNIX's LF characters. It does change the file contents, but this is a feature and desired.
PHPed needs the ability to transfer text files in ASCII mode, or set transfer mode by extension, like other FTP clients.
|
|
 |
 | |  |
Site Admin
Joined: 13 Jul 2003 |
Posts: 8351 |
|
|
 |
Posted: Mon Apr 06, 2009 1:45 pm |
|
 |
 |
 |
 |
You right, ASCII is the default mode but we do not use it just because in this mode the file content IS changed and it is NOT what we want. We want the file to remain UNCHANGED, WITHOUT any extra line endings. That's why we always use BINARY mode.
If your server CHANGES the files in this mode, just don't use it our use only UNIX file endings.
PhpED does recognize the line endings:
0x0D, 0x0A - as Windows
0x0A - as Unix
0x0D - as Mac
all other possible combinations may cause unexpected results.
Please DO CHECK the file content on the server before downloading it. If it is with BROKEN line endings, don't blame at us
Quote: | The ASCII transfer mode converts Windows' CRLF to UNIX's LF characters. It does change the file contents, but this is a feature and desired. |
This is a good theory. In practice many old Unix ftp servers does not handle Windows line endings at all  or corrupt them.
|
_________________ The PHP IDE team
|
 |
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT - 5 Hours
Page 1 of 1
|
|
|
|  |