Go Back   FlashFXP Forums > >

General Discussion Need help? Have a problem? Let us help you. Bug reports and feature requests should be made using the Bug Tracker or Feature Tracker

Closed Thread
 
Thread Tools Rate Thread Display Modes
Old 05-31-2007, 04:55 PM   #1
antifreeze
Junior Member
 
Join Date: May 2007
Posts: 8
Default extra 'returns' put into php files

When I upload php files, and then download them again for editing or backup, somehow extra
carriage returns are being put into the files. So for instance a file which was uploaded like this:

if ($style=="menu3") {

$SL3['prelink'] = "";
$SL3['postlink'] = "";
$SL3['linkclass'] = "";
$SL3['linkclass_hilite'] = "";


will look like this when downloaded again:

if ($style=="menu3") {


$SL3['prelink'] = "";

$SL3['postlink'] = "";

$SL3['linkclass'] = "";

$SL3['linkclass_hilite'] = "";



Any ideas what might be causing this?

Cheers.
antifreeze is offline  
Old 06-01-2007, 12:36 AM   #2
MxxCon
Super Duper
FlashFXP Beta Tester
 
Join Date: Oct 2001
Location: Brooklyn, NY
Posts: 3,881
Default

either enable auto transfer mode or manually switch to ASCII
__________________
[Sig removed by Administrator: Signature can not exceed 20GB]
MxxCon is offline  
Old 06-01-2007, 11:37 AM   #3
antifreeze
Junior Member
 
Join Date: May 2007
Posts: 8
Default

Auto is on.

> or manually switch to ASCII

Impossible. My website contains 800 php/text/html/css files and about 800 media files, all
mixed together in about 200-300 folders. I can't manually upload text and binary seperately.

Do you know for a fact that this is the cause of the problem?

Cheers.
antifreeze is offline  
Old 06-01-2007, 03:24 PM   #4
MxxCon
Super Duper
FlashFXP Beta Tester
 
Join Date: Oct 2001
Location: Brooklyn, NY
Posts: 3,881
Default

yes this is what normally causes extra line breaks.
when are they inserted? after uploading file to the server or after download?
what build of flashfxp? and all the other info from http://www.inicom.net/forum/showthread.php?t=4275
__________________
[Sig removed by Administrator: Signature can not exceed 20GB]
MxxCon is offline  
Old 06-01-2007, 04:09 PM   #5
antifreeze
Junior Member
 
Join Date: May 2007
Posts: 8
Default

OK, here's the whole process:

I usually develop and work on a local copy of my website on Win2000. I edit files with an editor called 'webBuilder 2006'. When ready I zip the whole site, ftp it to the server and unzip on the server.

I usually don't edit files on the server, however I've started to do so recently because I'm pushed for time and can't try out stuff locally first, so I've been editing the live site directly, and this is when I noticed this problem. It did not occur when I edited files locally.

I navigate to a file on the server using FlashFXP, click 'edit', and the file downloads to a cache. WebBuilder opens. I edit the file, save it, and click 'ok' to upload it again. On next trying to edit the file, it has extra carriage returns. If I open files that I haven't edited, they display properly.

I've tried looking for some setting in webBuilder which would cause this, but there is nothing.

Thanks.
antifreeze is offline  
Old 06-02-2007, 02:12 AM   #6
ranger
Member
FlashFXP Beta Tester
 
ranger's Avatar
 
Join Date: Jul 2005
Posts: 64
Default

I used to edit a website a while back and experienced some of the same issues. It was with an older version of Flashfxp, but for some reason when I would save the file by over writing the old one, I'd get the errors.

What I found to be a good work around was after downloading and doing the editing I needed, I would save the file under a different name, i.e. if you were editing flash.idx, I'd save the new one as flash1.idx. I'd then reupload it and once I had it the way I wanted, I'd delete the original and rename the edited one to whatever I needed it to be.

I can't tell you why it happens, but this way worked for me.... Hope it helps you out.
__________________
* FlashFXP v4.1.8 build 1708 BETA. registered
* Windows 7 Ultimate x86
* ESET Smart Security 5.0.95
* Cable Network
ranger is offline  
Old 06-02-2007, 03:39 AM   #7
antifreeze
Junior Member
 
Join Date: May 2007
Posts: 8
Default

Thanks for your replies.

Further information:

WebBuilder has a built-in ftp option that I've never used before. If I upload an edited php file using its own internal ftp capability, I don't get this error. So this is the best solution for me at the moment. Actually, this does improve my workflow a lot! The only potential problem is that the process is too seamless; with several files open at once in webBuilder, I could easily edit and save a 'live file' by mistake, thinking it was a local file!

As for deleting the extra carriage returns, I have found a way to do it in the 'search and replace' function, so I'll just fix the files quickly as I come across them; I only edited about 10 before I noticed this problem.

I think this issue needs to be looked at by the FlashFXP devs. Somewhere between clicking 'edit' in the menu, downloading a temporary file and then uploading the edited version, these extra carriage returns are being inserted into the file. I'm fairly sure that it is FlashFXP doing this, rather than the editor, although more testing would be required to be certain. I'm using version 3.4.0 (build 1145).


Cheers.

Last edited by antifreeze; 06-02-2007 at 08:39 AM.
antifreeze is offline  
Old 06-02-2007, 03:40 PM   #8
MxxCon
Super Duper
FlashFXP Beta Tester
 
Join Date: Oct 2001
Location: Brooklyn, NY
Posts: 3,881
Default

so far there is nothing for devs to look into because so far we haven't seen that this is actual problem.
1st we need to ensure that your flashfxp is properly configured.
post session log when you upload and download problematic file.
__________________
[Sig removed by Administrator: Signature can not exceed 20GB]
MxxCon is offline  
Old 06-03-2007, 12:06 PM   #9
antifreeze
Junior Member
 
Join Date: May 2007
Posts: 8
Default

OK, I've done some further testing and found what the problem might be.

After editing files in webBuilder, I used ANSI in 'pc format' to save files, which uses Windows CRLF line breaks. If I upload these php files directly in FlashFXP, they are automatically changed to acsii plain text (which changes the CRLF linebreaks to unix LF linebreaks).

However, regularly I zip up the whole local site and upload it. The zipping prevents the files I've edited from being converted into plain ascii. So on the server, most of the files have LF linebreaks, whilst the ones I've edited in webBuilder have CRLF linebreaks.

The problem, then, with subsequent editing is that FlashFXP doesn't seem to recognise CRLF linebreaks, whilst the cpanel filemanager on my server, and webBuilder do. This is why when I use webBuilder's own ftp capability the problem does not occur, but when FlashFXP opens the CRLF files (even in it's own internal editor), it inserts the 'extra' linebreaks.

The quick solution is simply to use the option in webBuilder to save as 'unix format', which uses LF linebreaks. This completely solves the issue for me and has no reprecussions for editing the local copy of my website either.

So, apologies; it appears that it is not a bug, but a simple deficiency in FlashFXP to recognise Windows linebreaks. I have no idea if it is an important enough issue for you to correct in a future version. I do know that many people running local copies of their website for development purposes have a similar workflow, so it might be useful to some people who are using Windows editors that are incapable of saving as unix format.

Thanks for your replies.
antifreeze is offline  
Old 06-03-2007, 03:28 PM   #10
MxxCon
Super Duper
FlashFXP Beta Tester
 
Join Date: Oct 2001
Location: Brooklyn, NY
Posts: 3,881
Default

actually it sounds like the server you are uploading to doesn't properly handle ascii transfers...the server should correct cr/lf to the proper format for its operating system.

as a workaround, you can upload files in binary mode, that way flashfxp won't modify cr/lf and will transfer them exactly as-is
__________________
[Sig removed by Administrator: Signature can not exceed 20GB]
MxxCon is offline  
Old 06-03-2007, 05:01 PM   #11
antifreeze
Junior Member
 
Join Date: May 2007
Posts: 8
Default

> actually it sounds like the server you are uploading to doesn't
> properly handle ascii transfers

Ok, but if that is true, then why do webBuilder and the cpanel
'file manager' both handle LF and CRLF files correctly?

Anyway, I'll leave it in your capable hands; I'm way out of my
depth, and just glad I was able to troubleshoot a quick solution.

Thanks for your responses and support.

Cheers.
antifreeze is offline  
Old 06-03-2007, 09:46 PM   #12
MxxCon
Super Duper
FlashFXP Beta Tester
 
Join Date: Oct 2001
Location: Brooklyn, NY
Posts: 3,881
Default

without seeing transfer log of webbuilder i wouldn't know why it's correctly transferring files..
afaik cpanel is a web based management frontend, right? if that's the case, it's not ftp transfer so these lf/cr issues are handled differently.
__________________
[Sig removed by Administrator: Signature can not exceed 20GB]
MxxCon is offline  
Closed Thread

Tags
$sl3[linkclass_hilite], $sl3[postlink], download, files, upload

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:23 PM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)