PHP 4.0 Bug #8700 Updated: File upload does not work at all.
| From: | sniper@php.net | Date: | Sun, 14 Jan 2001 22:08:50 +0000 |
| Subject: | PHP 4.0 Bug #8700 Updated: File upload does not work at all. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-44077@lists.php.net to get a copy of this message | ||
ID: 8700
Updated by: sniper
Reported By: nautica@clanman.com
Old-Status: Open
Status: Closed
Bug Type: Unknown/Other Function
Assigned To:
Comments:
Feedback by: Jon Tai <jon@tgpsolutions.com>
---------------------------------
My best guess is that you're trying to uploading a file bigger than 1000
bytes (only 1k). In my experience, the browser doesn't actually send the
file if it's bigger than MAX_FILE_SIZE. In my scripts, I use:
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo ((int)
get_cfg_var("upload_max_filesize"))*1024*1024; ?>">
so that MAX_FILE_SIZE is always consistent with what php.ini allows.
Previous Comments:
---------------------------------------------------------------------------
[2001-01-14 15:14:38] nautica@clanman.com
-- test.php --
<FORM ENCTYPE="multipart/form-data" ACTION="test_upload.php" METHOD=POST>
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000">
Send this file: <INPUT NAME="userfile" TYPE="file">
<INPUT TYPE="submit" VALUE="Send File">
</FORM>
-- test_upload.php --
<?php
if (is_uploaded_file($userfile)) {
copy($userfile, "/tmp/testupload");
} else {
echo "Possible file upload attack: filename '$userfile'.";
}
?>
Browser sends file..
but above script reports
Possible file upload attack: none
everytime you upload a file.. file is not to be found anywhere on the system.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=8700