I’m trying to debug a very strange problem with the $_FILES array. When I try to upload a file, only the ‘name’ key is set, the type, tmp_name, etc. are empty, and it’s returning error #1. For example:
Array
(
[name] => test.doc
[type] =>
[tmp_name] =>
[error] => 1
[size] => 0
)
test.doc is a valid file, I can open it without a problem. This is happening to a bunch of files I tested; doc, pdf, xls, ppt, jpg. The only file types that works are txt and gif.
I’m getting this problem on both on CentOS 5.3 w/PHP 5.2.6, Apache 2.2.3 and Ubuntu 8.04 w/PHP 5.2.4, Apache 2.2.8.
I thought I may have been mime types, but I checked the mime types and all the common ones are available.
Any ideas? I’ve never had this problem before!
Thanks.
According to the PHP documentation on file uploads, an error value of
1(AKAUPLOAD_ERR_INI_SIZE) means:You can try adjusting the
upload-max-filesizesetting.EDIT: The correct syntax for specifying
upload_max_filesizein megabytes is25M, not25MB. See the documentation on using shorthand for details.