Re: rename an uploaded file.

From: Date: Wed, 10 Aug 2005 21:18:40 +0000
Subject: Re: rename an uploaded file.
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-220383@lists.php.net to get a copy of this message
On Tue, August 9, 2005 6:16 am, Stut wrote: > Colons (:) are not allowed in Windows filenames. Of course they aren't allowed in file NAMES -- Because they are an integral part of a drive letter designation such as "C:" which is what is being used here. There's nothing wrong with the C: part of the filenames. >> $old = 'C:\\homedirectory\uploadedfiles\\newfile.gif'; > > Also, you don't need to escape the backslashes when using single quotes. But you should. ' and \ are both special character sequences inside of '' $string = 'Don\'t you know \\ is not the same as /?'; \h (or anything other than ' or \ behind \) will "work" but is not Good Programming, imho. You can also, in some versions, "get away" with having \ inside of "" so long as the following character isn't special: $string = "C:\homedirectory\uploadedfiles\\newfile.gif"; Note that the 'n' character is special (newline) but 'h' and 'u' are not (I don't think) so this "should work" That doesn't make it Good Practice. -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#220383) next »