Re: rename an uploaded file.

From: Date: Tue, 09 Aug 2005 13:16:00 +0000
Subject: Re: rename an uploaded file.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-220286@lists.php.net to get a copy of this message
Bosky, Dave wrote:
I seem to be having some trouble renaming a file after uploading it. It always returns a warning message indicating I have an invalid attribute in my rename statement. <snip>
$old = 'C:\\homedirectory\uploadedfiles\\newfile.gif'; $new = 'C:\\homedirectory\\uploadedfiles\\2005-08-05-09:00:00.gif'; move_uploaded_file(temp fileuploaded, $old); rename($old,$new);
Colons (:) are not allowed in Windows filenames. Also, you don't need to escape the backslashes when using single quotes. -Stuart

« previous php.general (#220286) next »