Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.0b4

Bug #4441 inaccurate error when uploading large file
Submitted: 2005-05-26 13:42 UTC
From: glen at delfi dot ee Assigned: antonio
Status: Closed Package: HTTP_Upload
PHP Version: 5.0.4 OS: Linux
Roadmaps: (Not assigned)    
Comments Add Comment Add patch

Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem : 38 - 6 = ?

 [2005-05-26 13:42 UTC] glen at delfi dot ee
Description: ------------ i have file uploaded which exceeds the upload_max_filesize diretive the object returns me NO_USER_FILE error. but inspecting $_FILES['userfile']['error'] it means that limit was reached instead. and secondly there's new error type available since 4.3.10: Reproduce code: --------------- set these php.ini variables: post_max_size = 8M upload_max_filesize = 2M and upload 3MB file. btw the $error is filled properly with TOO_LARGE constant and passed to HTTP_Upload_File() $files[$formname] = new HTTP_Upload_File($name, $tmp_name, $formname, $type, $size, $error, $this->lang, $this->_chmod); but the constructor marks missing size instantly as NO_USER_FILE: if (empty($name) || $size == 0) { $error = 'NO_USER_FILE'; } elseif ($tmp == 'none') { $error = 'TOO_LARGE'; here i also provide suggested code fix for the missing constant: // map error codes from 4.2.0 $_FILES['userfile']['error'] if (function_exists('version_compare') && version_compare(phpversion(), '4.2.0', 'ge')) { $uploadError = array( 1 => 'TOO_LARGE', 2 => 'TOO_LARGE', 3 => 'PARTIAL', 4 => 'NO_USER_FILE' ); if (version_compare(phpversion(), '4.3.10', 'ge')) { $uploadError[6] = 'NO_TMP_DIR'; } } Expected result: ---------------- isError() should return TOO_LARGE not NO_USER_FILE error. Actual result: -------------- error from upload says: NO_USER_FILE


 [2005-06-03 19:21 UTC] antonio
Can you please check if the error occurs with the cvs version?
 [2005-06-06 13:58 UTC] glen at delfi dot ee
 [2005-06-07 13:06 UTC] antonio
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on In case this was a website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.