PDA

View Full Version : creates double-spaces in a file when I download from server using FlashFXP.


DJAndre
12-17-2013, 03:19 PM
Here is some info you may need:

FlashFXP version: 4.4.3 Build 2029 -- I've been using FlashFXP since 3.x--and I update it each time there is a new version--so I don't know if perhaps some old settings need to be readjusted?
Sever: Linux
Apache version: 2.2.23
PHP version: 5.3.17
OS: Windows XP Professional.


I was wondering if you guys can help me troubleshoot this issue I am having with FlashFXP.

When I download a file (whether it's php or html) from my server using FlashFXP I notice that it creates double-spaced in between each line of the file--the entire file is double-spaced and if I then upload this new version to my site, and then download it a second time, it now shows triple spaces in between and so forth.

So far the only way I can download a file without it adding double spaces to each code line, I have to use CPanel's File Manager in order to get an exact replica of the file--this is important to me, since I also code lots of HTML and PHP files on my site (webmaster). Or if I use MS FrontPage, that program is able to download (backup the files without adding spaces in the lines)--so even MS FP's FTP backup feature gets it right.

When I upload a file, it doesn't do that, but when I download to my computer it created double spaced lines in each file. Below is an example of what I mean by blank double-spaces:

Normal file:
* Opera Mini - Set to true to treat Opera Mini like a mobile, false to treat it like full browser or set a URL (including http://) to redirect Opera Mini users to.
* Blackberry - Set to true to treat Blackberry like a mobile, false to treat it like full browser or set a URL (including http://) to redirect Blackberry users to.
* Palm - Set to true to treat Palm OS like a mobile, false to treat it like full browser or set a URL (including http://) to redirect Palm OS users to.


Downloaded from server to computer with FlashFXP:
* Opera Mini - Set to true to treat Opera Mini like a mobile, false to treat it like full browser or set a URL (including http://) to redirect Opera Mini users to.

* Blackberry - Set to true to treat Blackberry like a mobile, false to treat it like full browser or set a URL (including http://) to redirect Blackberry users to.

* Palm - Set to true to treat Palm OS like a mobile, false to treat it like full browser or set a URL (including http://) to redirect Palm OS users to.

Here is also an attachment of using a compare it program side by side from the original to the file then downloaded using FlashFXP. Notice the encoding.

Please let me know if you have further questions. Thanks in advance.

MxxCon
12-17-2013, 05:16 PM
This happens because there's a difference between how Linux and Windows treat new lines codes. You can read all the gory details here https://en.wikipedia.org/wiki/Newline
In FlashFXP press F6, Transfer, Transfer Mode. Make sure it's set to "Auto".

DJAndre
12-17-2013, 06:46 PM
Thanks for the reply...

Yes, it's set to "Auto" and also the option below it: "Use smart mode handling when Auto is selected." is "checked".

Just for testing, I installed FileZilla and that one doesn't seem to have this problem. So so far, MS FrontPage, Cpanel, and FileZilla don't have this issue when downloading from a "linux" server--I am surprised this can't be fixed (or tweaked) on FlashFXP, knowing there are lots of servers that prefer linux over Windows.

So are you sure this is something that FlashFXP can't fix?

Also notice my attachment above. The FlashFXP downloaded version is encoded as for MAC. So how did that happen from a Linux to Windows connection?

Plus I've always used linux servers--been with the same host for years. And back with FlashFXP 3 (something), I don't recall having this issue, since I code lots of html and php code.

MxxCon
12-17-2013, 11:58 PM
I am surprised this can't be fixed (or tweaked) on FlashFXP, knowing there are lots of servers that prefer linux over Windows.

So are you sure this is something that FlashFXP can't fix?
I never said that.
FlashFXP handles different encoding perfectly fine. It's just a matter of figuring out what's wrong with your config that doesn't work.
Also notice my attachment above. The FlashFXP downloaded version is encoded as for MAC. So how did that happen from a Linux to Windows connection?That "MAC" part is BS. Your software just clumps all Unix-like systems into the same group and calls it MAC. Linux, FreeBSD, OS X, many other OS use the same newline symbols.

Post session log of you uploading and downloading such a file to see what FlashFXP is doing.

DJAndre
12-18-2013, 01:41 AM
Something I'd like to point out.

The original php file on my computer is formatted as UNIX--that's what it states at the bottom of Notepad++. Plus when I create such files myself, that is the formatting I always select.

When I upload the php file using FLASHFXP from my PC to the server, I can still check the formatting on the server and it's still UNIX formatting for that file--plus if I open that file directly on the server, no blank spaces between the lines.

When I download the same file using FLASHFXP from the server to my PC, it then indicates as Macintosh as the formatting in Notepad++, which would be (my guess) the equivalent to the "Old Mac" formatting setting/option in Notepad++ (Preferences > New Document > Format).

So I assume that FlashFXP changes that formatting somehow?

Here is a Session LOG when I transfer such PHP file from the server to my PC:. (I X'd my username and login information to my site--to avoid hack attempts.)

Please let me now if you can suggest a fix? Thanks in advance.

FlashFXP 4.4.3 (build 2029)
Support Forums http://forum.flashfxp.com
Winsock 2.2 -- OpenSSL 1.0.1e 11 Feb 2013
[R] Connecting to XXXXXXXX -> IP=XXXXXXXXX PORT=21
[R] Connected to XXXXXXXXXXX
[R] 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
[R] 220-You are user number 1 of 46 allowed.
[R] 220-Local time is now 01:18. Server port: 21.
[R] 220-IPv6 connections are also welcome on this server.
[R] 220 You will be disconnected after 15 minutes of inactivity.
[R] USER XXXXXX
[R] 331 User XXXXXXXX OK. Password required
[R] PASS (hidden)
[R] 230 OK. Current restricted directory is /
[R] SYST
[R] 215 UNIX Type: L8
[R] FEAT
[R] 211-Extensions supported:
[R] EPRT
[R] IDLE
[R] MDTM
[R] SIZE
[R] MFMT
[R] REST STREAM
[R] MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNI X.gid*;unique*;
[R] MLSD
[R] AUTH TLS
[R] PBSZ
[R] PROT
[R] ESTA
[R] PASV
[R] EPSV
[R] SPSV
[R] ESTP
[R] 211 End.
[R] PWD
[R] 257 "/" is your current location
[R] CWD /public_html
[R] 250 OK. Current directory is /public_html
[R] PWD
[R] 257 "/public_html" is your current location
[R] Listening on PORT: 3571, Waiting for connection.
[R] PORT 192,168,1,108,13,243
[R] 200 PORT command successful
[R] MLSD
[R] 150 Connecting to port 2040
[R] 226-Options: -a -l
[R] 226 56 matches total
[R] List Complete: 6 KB in 0.37 second (6.1 KB/s)
[R] CWD /public_html
[R] 250 OK. Current directory is /public_html
[R] PWD
[R] 257 "/public_html" is your current location
[R] Listening on PORT: 3572, Waiting for connection.
[R] PORT 192,168,1,108,13,244
[R] 200 PORT command successful
[R] MLSD
[R] 150 Connecting to port 2041
[R] 226-Options: -a -l
[R] 226 56 matches total
[R] List Complete: 6 KB in 0.35 second (6.1 KB/s)
[R] PWD
[R] 257 "/public_html" is your current location
[R] TYPE A
[R] 200 TYPE is now ASCII
[R] PORT 192,168,1,108,13,245
[R] 200 PORT command successful
[R] RETR index.php
[R] 150-Connecting to port 2042
[R] 150 6.0 kbytes to download
[R] 226-File successfully transferred
[R] 226 0.000 seconds (measured here), 55.45 Mbytes per second
Download: index.php 6 KB in 0.00 second (6.1 KB/s)
Transfer queue completed
Transferred 1 File (6 KB) in 0.43 second (6.1 KB/s)

MxxCon
12-18-2013, 08:51 AM
The original php file on my computer is formatted as UNIX--that's what it states at the bottom of Notepad++. Plus when I create such files myself, that is the formatting I always select.So that's the problem.
FlashFXP assumes that local text files are formatted with Windows newline char.
So I assume that FlashFXP changes that formatting somehow?
[R] TYPE A
[R] 200 TYPE is now ASCII
[R] PORT 192,168,1,108,13,245
[R] 200 PORT command successful
[R] RETR index.php

TYPE A is a command that tell server a server transfer will be of a text file and to adjust newline characters.
Since your files already match newline chars of the destination server, such files should be transferred unchanged using "IMAGE" mode.
There 2 ways of doing that.
Either in preferences you can change it from Auto to Binary. But that means all files will always be transferred unchanged. Even the ones that should be converted.
Or if your .php files are always in UNIX format but you are not sure about other text files, go to 'Options' menu, 'Filters', and remove extensions of the files stored in UNIX format.

DJAndre
12-18-2013, 02:22 PM
I've recently read that switching to Binary can corrupt some files during transfer.

Here is something I don't quite understand. When I upload the UNIX file to the server it stays intact. No changes. So the filter for PHP to be transferred as ASCII is working.

But when I download from the server to my PC, that's when the file gets changed, even though it's the same setting for the transfer. Something has to give? How come other transfer tools are not having this issue? (i.e. MS FrontPage, FileZilla, CPanel, and even Windows built in FTP browser).

So just as an experimentation, I deleted from the ASCII filter the extension .php. I then transferred a file from the server to my PC and no more double spaces in between, but it did change the formatting from UNIX to Windows/DOS. Below is the Session Log for the download:

FlashFXP 4.4.3 (build 2029)
Support Forums http://forum.flashfxp.com
Winsock 2.2 -- OpenSSL 1.0.1e 11 Feb 2013
[R] Connecting to XXXXXXXXX -> IP=XXXXXXXX PORT=21
[R] Connected to XXXXXXXXXXX
[R] 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
[R] 220-You are user number 1 of 46 allowed.
[R] 220-Local time is now 14:41. Server port: 21.
[R] 220-IPv6 connections are also welcome on this server.
[R] 220 You will be disconnected after 15 minutes of inactivity.
[R] USER XXXXXXX
[R] 331 User XXXXX OK. Password required
[R] PASS (hidden)
[R] 230 OK. Current restricted directory is /
[R] SYST
[R] 215 UNIX Type: L8
[R] FEAT
[R] 211-Extensions supported:
[R] EPRT
[R] IDLE
[R] MDTM
[R] SIZE
[R] MFMT
[R] REST STREAM
[R] MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNI X.gid*;unique*;
[R] MLSD
[R] AUTH TLS
[R] PBSZ
[R] PROT
[R] ESTA
[R] PASV
[R] EPSV
[R] SPSV
[R] ESTP
[R] 211 End.
[R] PWD
[R] 257 "/" is your current location
[R] CWD /public_html
[R] 250 OK. Current directory is /public_html
[R] PWD
[R] 257 "/public_html" is your current location
[R] Listening on PORT: 3604, Waiting for connection.
[R] PORT 192,168,1,108,14,20
[R] 200 PORT command successful
[R] MLSD
[R] 150 Connecting to port 2110
[R] 226-Options: -a -l
[R] 226 57 matches total
[R] List Complete: 6 KB in 0.32 second (6.2 KB/s)
[R] CWD /public_html
[R] 250 OK. Current directory is /public_html
[R] PWD
[R] 257 "/public_html" is your current location
[R] Listening on PORT: 3605, Waiting for connection.
[R] PORT 192,168,1,108,14,21
[R] 200 PORT command successful
[R] MLSD
[R] 150 Connecting to port 2111
[R] 226-Options: -a -l
[R] 226 57 matches total
[R] List Complete: 6 KB in 0.32 second (6.2 KB/s)
[R] TYPE I
[R] 200 TYPE is now 8-bit binary
[R] PORT 192,168,1,108,14,22
[R] 200 PORT command successful
[R] RETR index.php
[R] 150-Connecting to port 2112
[R] 150 6.0 kbytes to download
[R] 226-File successfully transferred
[R] 226 0.000 seconds (measured here), 54.30 Mbytes per second
Download: index.php 5 KB in 0.00 second (6.0 KB/s)
Transfer queue completed
Transferred 1 File (5 KB) in 0.41 second (6.0 KB/s)


I also plan to test what happens when I transfer a UNIX php file to the server, to see if that formatting also changes?

Update: Transferring the UNIX php file to the server from my PC, still stays as UNIX. Below is the session log for the upload.

FlashFXP 4.4.3 (build 2029)
Support Forums http://forum.flashfxp.com
Winsock 2.2 -- OpenSSL 1.0.1e 11 Feb 2013
[R] Connecting to XXXXXX -> IP=XXXXXXXXX PORT=21
[R] Connected to XXXXXXXXX
[R] 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
[R] 220-You are user number 1 of 46 allowed.
[R] 220-Local time is now 14:44. Server port: 21.
[R] 220-IPv6 connections are also welcome on this server.
[R] 220 You will be disconnected after 15 minutes of inactivity.
[R] USER XXXXXXX
[R] 331 User XXXXXXX OK. Password required
[R] PASS (hidden)
[R] 230 OK. Current restricted directory is /
[R] SYST
[R] 215 UNIX Type: L8
[R] FEAT
[R] 211-Extensions supported:
[R] EPRT
[R] IDLE
[R] MDTM
[R] SIZE
[R] MFMT
[R] REST STREAM
[R] MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNI X.gid*;unique*;
[R] MLSD
[R] AUTH TLS
[R] PBSZ
[R] PROT
[R] ESTA
[R] PASV
[R] EPSV
[R] SPSV
[R] ESTP
[R] 211 End.
[R] PWD
[R] 257 "/" is your current location
[R] CWD /public_html
[R] 250 OK. Current directory is /public_html
[R] PWD
[R] 257 "/public_html" is your current location
[R] Listening on PORT: 3635, Waiting for connection.
[R] PORT 192,168,1,108,14,51
[R] 200 PORT command successful
[R] MLSD
[R] 150 Connecting to port 2113
[R] 226-Options: -a -l
[R] 226 56 matches total
[R] List Complete: 6 KB in 0.32 second (6.1 KB/s)
[R] CWD /public_html
[R] 250 OK. Current directory is /public_html
[R] PWD
[R] 257 "/public_html" is your current location
[R] Listening on PORT: 3636, Waiting for connection.
[R] PORT 192,168,1,108,14,52
[R] 200 PORT command successful
[R] MLSD
[R] 150 Connecting to port 2114
[R] 226-Options: -a -l
[R] 226 56 matches total
[R] List Complete: 6 KB in 0.32 second (6.1 KB/s)
[R] TYPE I
[R] 200 TYPE is now 8-bit binary
[R] MLST testfile.php
[R] 550 Can't check for file existence
[R] PORT 192,168,1,108,14,53
[R] 200 PORT command successful
[R] STOR testfile.php
[R] 150 Connecting to port 2115
[R] 226-File successfully transferred
[R] 226 0.226 seconds (measured here), 25.49 Kbytes per second
Upload: testfile.php 5 KB in 0.23 second (5.8 KB/s)
[R] MFMT 20131218193229 /public_html/testfile.php
[R] 213 UTIME OK
Transfer queue completed
Transferred 1 File (5 KB) in 0.83 second (5.8 KB/s)


Now to solve why the formatting changes from UNIX to Windows/DOS when being transferred from server to PC.

I consulted with a PHP developer and he said that perhaps FileZilla fixed this issue on their end, because most PHP devs use that "free" platform than FlashFXP. So of course that issue was reported to FileZilla devs about this issue and they must have fixed it on their end. FlashFXP devs perhaps need to catch up with this issue.

FileZilla does not change the formatting when I download the UNIX files to my PC. They stay intact in the same formatting.

MxxCon
12-19-2013, 01:05 AM
I've recently read that switching to Binary can corrupt some files during transfer.That is incorrect. It's impossible for Binary transfer to "corrupt" files because it transfer everything 1:1 byte-identical.
If you transfer binary file as ASCII then yes, it will corrupt it.

I consulted with a PHP developer and he said that perhaps FileZilla fixed this issue on their end, because most PHP devs use that "free" platform than FlashFXP. So of course that issue was reported to FileZilla devs about this issue and they must have fixed it on their end. FlashFXP devs perhaps need to catch up with this issue.Baseless conjecture.
FlashFXP has been around for about 15 years now and has been used by countless web developers all over the world.
FlashFXP transfer file binary and ascii files just fine. It's just the matter of figuring out what's wrong with your setup.

Post session log from filezilla showing what transfer mode it uses.

In notepad++ go to "View" menu, "Show Symbol", "Show end of Line". See what kind of characters do you have in your files.

DJAndre
12-19-2013, 02:42 PM
Once again, thank you for your support. Hopefully we can find a fix and I can continue using FlashFXP as my FTP client. I have not gotten used to using FileZilla--I kept everything at default when I installed it.

Post session log from filezilla showing what transfer mode it uses.

So here is the log of downloading a PHP UNIX file from my server: (Due notice that when it detects the /public_html directory it classifies it as 8-bit binary--something that FlashFXP doesn't display in it's LOG. -- I don't know if it's because in FlashFXP I have it set up the mode to Active and not PASV? -- Click here to learn why I adjusted FlashFXP to Active mode: https://oss.azurewebsites.net/forum/flashfxp/general-discussion/12586-data-socket-error-connection-timed.html -- notice the date :)

Also, even if FlashFXP is set up to PASV mode, it doesn't fix my issue.

FileZilla's LOG:
Status: Connecting to XXXXXXXXX...
Status: Connection established, waiting for welcome message...
Response: 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
Response: 220-You are user number 1 of 46 allowed.
Response: 220-Local time is now 14:17. Server port: 21.
Response: 220-IPv6 connections are also welcome on this server.
Response: 220 You will be disconnected after 15 minutes of inactivity.
Command: USER ********
Response: 331 User ******** OK. Password required
Command: PASS *********
Response: 230 OK. Current restricted directory is /
Command: SYST
Response: 215 UNIX Type: L8
Command: FEAT
Response: 211-Extensions supported:
Response: EPRT
Response: IDLE
Response: MDTM
Response: SIZE
Response: MFMT
Response: REST STREAM
Response: MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNI X.gid*;unique*;
Response: MLSD
Response: AUTH TLS
Response: PBSZ
Response: PROT
Response: TVFS
Response: ESTA
Response: PASV
Response: EPSV
Response: SPSV
Response: ESTP
Response: 211 End.
Status: Server does not support non-ASCII characters.
Status: Connected
Status: Retrieving directory listing...
Command: CWD /public_html
Response: 250 OK. Current directory is /public_html
Command: PWD
Response: 257 "/public_html" is your current location
Command: TYPE I
Response: 200 TYPE is now 8-bit binary
Command: PASV
Response: 227 Entering Passive Mode (XXXXXXXXXX,109,73)
Command: MLSD
Response: 150 Accepted data connection
Response: 226-Options: -a -l
Response: 226 56 matches total
Status: Directory listing successful
Status: Connecting to XXXXXXXXX...
Status: Connection established, waiting for welcome message...
Response: 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
Response: 220-You are user number 2 of 46 allowed.
Response: 220-Local time is now 14:17. Server port: 21.
Response: 220-IPv6 connections are also welcome on this server.
Response: 220 You will be disconnected after 15 minutes of inactivity.
Command: USER ********
Response: 331 User ******** OK. Password required
Command: PASS ********
Response: 230 OK. Current restricted directory is /
Status: Server does not support non-ASCII characters.
Status: Connected
Status: Starting download of /public_html/index.php
Command: CWD /public_html
Response: 250 OK. Current directory is /public_html
Command: TYPE A
Response: 200 TYPE is now 8-bit binary
Command: PASV
Response: 227 Entering Passive Mode (XXXXXXXXX,109,16)
Command: RETR index.php
Response: 150-Accepted data connection
Response: 150 6.0 kbytes to download
Response: 226-File successfully transferred
Response: 226 0.000 seconds (measured here), 51.69 Mbytes per second
Status: File transfer successful, transferred 6,280 bytes in 1 second

In notepad++ go to "View" menu, "Show Symbol", "Show end of Line". See what kind of characters do you have in your files.


For the UNIX original PHP files it ends with: LF (see screenshot attachment: BEFORE)

For the same PHP file downloaded from my server by FlashFXP is ends with: CR CR LF (see screenshot attachment: AFTER)

bigstar
12-19-2013, 04:15 PM
If you're using a text editor such as NotePad++ then then the recommended solution is to change the transfer mode to BINARY and transfer all files in BINARY mode.

This will preserve the file formatting and integrity of the file.

The problem you're noticing can be caused by using ASCII mode to transfer the files or in this case (auto) mode. If you transferred the file in BINARY mode then the line endings would be identical on the server and the local copy.

These days many FTP servers do not allow ASCII transfers by default (.conf setting) because this mode requires more overhead and system resources and while these FTP servers may appear to allow ASCII mode the transfer will in fact be in BINARY.

And some FTP servers can accidentally mangle text documents when sent in ASCII mode. For example if the FTP server is running on a LINUX/UNIX OS and the text file is CR/LF formatted then attempting to transfer the file in ASCII mode may result in CR/CR/LF. (which is most likely the cause of your specific problem)

When setting the transfer mode to ASCII or BINARY this operation is a server side feature, the FTP server is responsible for performing the conversion. On the client side the data received or sent the same way regardless of the transfer mode.

Some FTP clients have supplemented the ASCII/Binary conversion by always using BINARY mode and then by performing the text conversion within the client software, however FlashFXP does not do this.

How to set the default transfer mode to Binary (image)
Start FlashFXP
Then from the main menu select Options > Preferences
From the Preferences dialog select Transfer
Change the Transfer Mode to Binary (image)
Click the OK button

Now when you start FlashFXP it will default to use Binary (image) for the Transfer Mode.
(it does not however change the transfer mode for the current instance of FlashFXP)


https://oss.azurewebsites.net/images/forum/flashfxp-set-default-transfer-mode.png

DJAndre
12-19-2013, 04:58 PM
@BigStar, thanks for the recommendation. I will set it to Binary Mode.

One thing I noticed by carefully looking for the filter settings in FileZilla, that they don't include PHP files for ASCII mode by default. Perhaps this is the reason why there isn't a problem with that client app.

One more question to you BigStar?

When I set FlashFXP to download in Binary, in Notepad++ it displays the formatting of the file to be Windows/DOS, where the original file was formatted for UNIX. Is there a way to also fix that? Or is that still normal?

I don't know what kind of settings MS FrontPage has on it's built-in FTP, but when I use that to backup my site, the files are all perfect UNIX / without space lines in between.

Also, I found this explanation about Pure-FTPd, which my server seems to run (according to the info provided in the above Session Logs). May be something you guys can read? http://www.novell.com/support/kb/doc.php?id=7008378

DJAndre
12-19-2013, 05:07 PM
Here is a screenshot of what the results are when I transfer from my server to my PC a UNIX PHP file. Notice the CR LF at the end of each line and also the Formatting DOS/Windows

bigstar
12-19-2013, 10:46 PM
When I set FlashFXP to download in Binary, in Notepad++ it displays the formatting of the file to be Windows/DOS, where the original file was formatted for UNIX. Is there a way to also fix that? Or is that still normal?

Are you 100% sure the file was downloaded in binary mode?

If you are then most likely the format of the file on the server was changed from UNIX to WINDOWS.

You can change the format within Notepad++
Under Edit > EOL conversion > Unix format

Save the file and upload it, then re-download it with FlashFXP, it should be in Unix format.

DJAndre
12-20-2013, 01:30 PM
After rebooting my machine the files that I now download from my server stay in UNIX format using FlashFXP. So consider this solved.

Just to give summary, the reason for ASCII is to convert txt based files so we could open them in our OS apps and they all don't appear like one horizontal line of code, so it's formatted so our txt based readers can view them with proper "returns".

And since I use Notepad++ and not Notepad that comes default for Windows, I would not need for these txt based files to be converted, since I use that app.

Am I correct with my assumption for the purpose of such setting?

X3
12-20-2013, 04:21 PM
Here http://www.cs.toronto.edu/~krueger/csc209h/tut/line-endings.html

That says it all.

And if you have ssh access then instead of going through more pain read this http://stackoverflow.com/questions/2613800/how-to-convert-dos-windows-newline-to-unix-newline-in-bash-script

And then all your server files will be with correct line endings and ffxp never changes line endings for anything unless your 3rd party apps do it. either it was you or someone else but fro what I gather it wasnt ffxp. ;>

DJAndre
12-20-2013, 05:40 PM
ffxp never changes line endings for anything unless your 3rd party apps do it. either it was you or someone else but fro what I gather it wasnt ffxp. ;>
With all due respect, that is not what was hashed out in this help topic. IMHO, you should spend some time reading it thoroughly, because what you just stated is wrong and it later causes misinformation and misunderstandings going forward.

If FFXP's Transfer Mode is set to Auto and PHP files are in the ASCII filter (as well as other types of files), it will change "line endings" from a LINUX server to a Windows PC transfer if the files have specific formats (i.e. UNIX).

The solution was to switch Transfer Mode to BINARY. Which will stop FFXP to make changes to certain files--according to it's ASCII filter settings.

My previous post was for me to have a clear understanding for the purpose for ASCII transfer mode. I just need someone to verify if that is what it's meant for--in layman terms. Because I really don't see another reason for it's purpose, especially since it will cause these kinds of issues for us that require certain files to be a specific format.

Before, I was relying on different methods to download a file for me to edit or work on, so it could keep it's original formatting. Since FFXP was giving me odd results, I was deterred in using this app. Now that I've come forward and asked the experts here, I was finally given a setting I can work with, and I am much more happier, since this will help me immensely with efficiency in tackling these tasks going forward.

X3
12-21-2013, 08:59 AM
I use Linux servers daily and have similar uses for unix line endings just like you, in fact my files are all unix style line endings, and auto mode never done any of this for me in ffxp and I also use notepad++, I do not use binary exclusively in ffxp.

I also read this topic and been following it from beginning, and your reaction just makes me wonder. My reply is purely because;
My ffxp settings are auto and checked [x] use smart mode handling when auto is selected. What I feel odd is that you has a problem and I do not with exact similar file formatting.
However my files are created in Linux via ssh and nano.

Edit.

Actually I just noticed that notepad++ by default my file creation is unix line endings I create a test.php or test.whatever and it automatically dos/windows and no matter what it never saves that file with unix line endings even after changing it it manually. That is both locally and remotely via windows or ffxp.

So here it is, notepad++ alone and no ffxp in sight bingo. But that's just my findings.

bigstar
12-21-2013, 09:21 AM
Just to give summary, the reason for ASCII is to convert txt based files so we could open them in our OS apps and they all don't appear like one horizontal line of code, so it's formatted so our txt based readers can view them with proper "returns".

And since I use Notepad++ and not Notepad that comes default for Windows, I would not need for these txt based files to be converted, since I use that app.

Am I correct with my assumption for the purpose of such setting?

Yes that is 100% correct and is perfectly fine for your specific situation.

bigstar
12-21-2013, 09:40 AM
After this long winded thread I thought it would make sense to add a re-cap.



When using ASCII transfer mode the file EOL (end of line) characters are swapped by the FTP server. If the FTP server is UNIX then CR is typically swapped to CR/LF, depending on the FTP server software and the way it is configured, in some configurations switching to ASCII mode may not actually do any conversion at all.



Some UNIX based FTP servers have been known to mangle the EOL characters especially when the file content doesn't use the UNIX style EOL character, if the remote file is Windows formatted EOL then it could result in replacing CR/LF with CR/CR/LF.



Resuming files transferred in ASCII mode can lead to corruption due to the way the EOL characters are handled and converted by the FTP server.



If you're using a text editor such as NotePad++ then using ASCII mode is not necessary and you may have better results using BINARY mode for everything.



The only time ASCII mode might be necessary is if you're transferring configuration files between a FTP server running on UNIX (or other) to WINDOWS for use with some software that requires the EOL to be specific to the operating system.
It is becoming more and more common for FTP servers to use BINARY mode for everything.



When transferring files using the SFTP over SSH protocol FlashFXP will always transfer the file in BINARY mode.