RE: [PHP] File upload on Win2k ...
| From: | Rich Gray | Date: | Wed, 27 Nov 2002 05:44:32 +0000 |
| Subject: | RE: [PHP] File upload on Win2k ... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-126191@lists.php.net to get a copy of this message | ||
Don't bother to respond people... worked out the issue - the double
backslashes in the name...
Cheers
Rich
-----Original Message-----
From: Rich Gray [mailto:rich@f1central.net]
Sent: 26 November 2002 21:14
To: php-general@lists.php.net
Subject: [PHP] File upload on Win2k ...
PHP v4.2.3
Win2K Sp2
Apache v1.3.24
I'm testing some file upload code for a image library type site and the file
upload keeps failing... here's some code to explain what the issue is...
<?
// The form has been posted and we are processing the posted data
print_r($_FILES);
copy($_FILES['userpic']['tmp_name'],'c:/test.jpg');
echo (is_uploaded_file($_FILES['userpic']['tmp_name']) ?
'<br>Uploaded' :
'<br>Not Uploaded');
?>
This outputs the following:-
Array ( [userpic] => Array ( [name] => garden.jpg [type] => image/pjpeg
[tmp_name] => C:\\WINNT\\TEMP\\phpC0.tmp [error] => 0 [size] => 59501 ) )
Not Uploaded
The copy() function works in that the temp file is copied to c:\test.jpg.
So why is is_uploaded_file() returning false?
TIA
Rich
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php