Hello erayfield, I'm afraid you have lost me.
The code in question is actually a class method
- //ftp_rename returns false if the file already exists.
-
//Doesn't seem to be an overwrite
-
public function movefile($filename,$from='',$to='')
-
{
-
print "<br>Move file - from $from.$filename to $to.$filename";
-
if(ftp_rename($this->resource,$from.$filename,$to.$filename))
-
return true;
-
echo "ftp_rename failed moving $filename from $from to $to";
-
return false;
-
}
The scenario is I am downloading order files for processing.
If the order file has a problem I move it to a 'Problems' folder, where a third party can amend the file.
But they don't always remove the file from Problems and amend the file correctly, so at the next download ftp_rename() tries to place the file in Problems again, but fails