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?