Hmm. I've taken your suggestion and it still isn't working. Instead I get the following error:
Warning: Unable to open '' for reading: Permission denied in c:\phpweb/fuploadconfirm.php on line 15
Error
Warning: Unlink failed (No such file or directory) in c:\phpweb/fuploadconfirm.php on line 31
Where Line 15 is:
if(copy($userfile,"c:/phpweb/userpics/$CUserName.jpg"))
AND
Line 31 is:
unlink($userfile)
Kirk Parker wrote:
Well, I do see something wrong, now that I look back at it, but it doesn't seem that this would cause the particular misbehavior you are actually seeing:
You give the destination argument to copy() as:
"c:\phpweb\pics\$CUserName.jpg"
but clearly that second and third backslash should be doubled, too:
"c:\phpweb\pics\$CUserName.jpg"
BTW, Windows (and even DOS before it) was perfectly happy to use forward slashes in filenames; it's only command.com and (alas) cmd.exe that insists that the path-component separator be a backslash. So if you are sure that the variable will never be passed as an argument to system(), exec(), etc, then
go ahead and say:
"c:/phpweb/pics/$CUserName.jpg"
Less chance of this particular error happening. :-)