Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

$_FILES array only has partial info

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.

like image 446
Daniel Avatar asked Dec 17 '22 03:12

Daniel


1 Answers

The error code of 1 means the file exceeds the maximum upload size set in php.ini.

All the various errors messages are explained here: http://php.net/manual/en/features.file-upload.errors.php

like image 191
Tim Cooper Avatar answered Dec 30 '22 15:12

Tim Cooper