Error: File upload error (unknown error code).

See all posts See thread Reply

Re: Error: File upload error (unknown error code). new!
by Dennis, 16 years ago
Hi,

yes, enctype="multipart/form-data" and the max file size tag are inculded.

First i thought, that i set the wrong upload directory but i can change it to anything: same problem.

This is the var_dump $_FILES output:
array(1) { ["upload_file"]=> array(5) { ["name"]=> string(10) "Winter.jpg" ["type"]=> string(0) "" ["tmp_name"]=> string(0) "" ["error"]=> int(6) ["size"]=> int(0) } }

In my php.ini the upload_tmp_dir is set to no value - is it okay?

e.g. in Wordpress does the upload work..no problems..Reply
Re: Error: File upload error (unknown error code). new!
by colin, 16 years ago
I assume that your php.ini is correct if Wordpress works.

upload_tmp_dir can be empty ("no values" in a phpinfo()), in which case PHP will use the system default temp directory.

However, your dump indicates that the error code is 6, which is UPLOAD_ERR_NO_TMP_DIR: "Value: 6; Missing a temporary folder. Introduced in PHP 4.3.10 and PHP 5.0.3"

So there is definitively a problem with your temp folder. Try to set it explicitly in your php.ini.Reply