[thelist] [PHP] is_uploaded_file() returning false
Rich Gray
richardgray at onetel.co.uk
Mon Sep 2 10:45:01 CDT 2002
Nedret,
Try...
is_uploaded_file($_FILES['userfile']['tmp_name'])) {
// Blah Blah
}
HTH
Rich
-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Nedret Saidova
Sent: 02 September 2002 15:50
To: thelist at lists.evolt.org
Subject: [thelist] [PHP] is_uploaded_file() returning false
Hi there,
Anyone happen to know what could be the reason that
is_uploaded_file() returns false?
Some info:
*********************
Running on Windows IIS5
*********************
in php.ini:
file_uploads = On
upload_tmp_dir = C:\PHP\uploadtemp
upload_max_filesize = 2M
************************
The image I'm trying to upload is not larger than 2M
************************
The form:
<form enctype="multipart/form-data" action="<? echo
$PHP_SELF."?Action=Add";?>" method="post">
<table width="650" border="0">
<tr>
<td><div align="right">Send this file:</div></td>
<td><input name="userfile" type="file"></td>
</tr>
<tr>
<td><div align="right">Which of the following would you like
to do
next?</div></td>
<td><select name="Next" id="Next">
<option value="image">Insert Another Picture</option>
<option><<- Finished for now ->></option>
</select></td>
</tr>
<tr>
<td><div align="right">
<input name="Ref_ID" type="text"
value="<?=$Ref_ID.'.jpg'?>">
</div></td>
<td><input name="submit" type="submit" value="Send
File"></td>
</tr>
</table>
</form>
************************
Did not set a hidden field for MAX_FILE_SIZE just as yet...
************************
The script:
$path = "./IMAGES/";
if (is_uploaded_file($_FILES['userfile']['name']))
{
copy($_FILES['userfile']['name'], $path);
}
else
{
echo "No upload...";
echo $_FILES['userfile']['tmp_name'];
echo "<br>";
echo $_FILES['userfile']['size'];
echo "<br>";
echo $_FILES['userfile']['name'];
}
************************
No error is returned - just no file in the C:\PHP\uploadtemp of the
server. And naturally printed result on page:
C:\PHP\uploadtemp\php1A9.tmp 73 bullet12.gif
************************
Any ideas?
Thanks in advance.
Real stuck:
Nedret
------- End of forwarded message -------
--
For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !
More information about the thelist
mailing list