Re: rename an uploaded file.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux