Not sure about other functions, but in this one I have found, that you are using '/' instead of DIRECTORY_SEPARATOR constant for creating paths to directories. This has caused me some issues with Windows mashine, as it didn't recognized the path 'c:\path\to\somewhere/file.txt' (note that last '/' instead of '\'). PHP has DIRECTORY_SEPARATOR constant specific to the platform it was installed on, which lots of developers likes to use as

define ('DS', DIRECTORY_SEPARATOR);

in the bootstrap phase for shorter further code.

Small example:

...
$source = $_FILES['files']['tmp_name']['my_field'];
$destination = 'c:\path\to\somewhere';

if (file_move($source, $destination, FILE_EXISTS_RENAME)) { // file_move() uses function file_copy()
rename($source, '...');  // Windows will try to locate that $source file with '/' in it's path and will not find it, althoug the file will be present on that directory if you would use '\' instead of '/'
}
...

Hope that makes sense, just use DIRECTORY_SEPARATOR in the future.

Thank you.

Comments

dpearcefl’s picture

Status: Active » Closed (won't fix)

Considering the age of this issue with no comments and that Drupal 5 is no longer supported, I'm closing this ticket.