Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Give better error messages in the example upload.php #629
Many people just need a quick uploader, and use the embedded example code. I actually thought the code was wrong, which it wasn't, but found my real error after actually printing out the error code that PHP provides.
This patch exposes that error code (along with a helpful message).
This was referenced
Oct 5, 2012
didn't fix the problem for me! The uploaded file is 0 bytes while before this no file was created in the server. I'm using Chromium Version 20.0.1132.47 Ubuntu 12.04 (144678).
@mehran20 Hmm, you're in fact totally correct.
It's a totally different problem (on my side, and potentially at yours too):
upload_max_filesize is too small: http://no.php.net/manual/en/ini.core.php#ini.upload-max-filesize
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
@velmont in general upload.php is just an example. You can enhance it in any way you find appropriate. However we do not plan to expand it any further. Opposite in fact - I'm looking to cut it down :)