TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 10-26-2008, 08:50 PM   #1 (permalink)
The Contributor
 
Join Date: Apr 2008
Posts: 78
Thanks: 0
benton is on a distinguished road
Default Ftp file mode problem - spaces in files

I do a lot of work with files obtained via ftp. I have a lot of problems with the files being in the wrong mode and when they are uploaded back to the server, the site fails because the file isn't formatted correctly. It gives the Header Already Sent message, due to extra spaces at the end of the file. Another problem this causes is the introduction of spaces between the lines. A file might start off with
Code:
<?php
line 1
line 2
line 3
but ends up with
Code:
<?php

line 1

line 2

line 3
I've seen some files with 10 empty lines between each line.

I've searched all over and found a few programs that will convert the files to dos mode, and that helps a little. But the conversion can only be one at a time and I've had instances of close to 100 files that had to be edited, so that really isn't a solution.

I've tried setting my ftp program to passive and non-passive mode, and have used other ftp programs. The problem isn't consistent but will eventually occur no matter what I try. I talked to the authors of one of the ftp programs and he said the ftp programs couldn't cause that. That it was the server that wasn't writing the file in the correct way.

So I'm wondering if anyone knows of a fix for this, or at least a way to quickly convert the files. From what I've seen on the web, it is a common problem but no one seems to have a solution. Does anyone have any suggestions?
benton is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 12:52 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design