Error: File upload error (unknown error code).

See all posts Reply

Error: File upload error (unknown error code). new!
by Dennis, 15 years, 5 months ago
Hi,

i tried to upload a file with the demo files included in the download package.

But i doesn't work. I receive the error message: Error: File upload error (unknown error code).

My Debug:
system information
- GD version : 2.0
- supported image types : png jpg gif bmp
- open_basedir : /var/www/htdocs/dennis/upload/:/test2/
- language : en_GB
source is an uploaded file
- source variables
file_src_name :
file_src_name_body :
file_src_name_ext :
file_src_pathname :
file_src_mime :
file_src_size : (max= 2097152)
file_src_error : 6
Reply
Re: Error: File upload error (unknown error code). new!
by colin, 15 years, 5 months ago
You are using the provided demo without any changes? Are you sure your have the enctype="multipart/form-data" property in your FORM tag?

If you remove the open_basedir restriction on your server, does the demo work?Reply
Re: Error: File upload error (unknown error code). new!
by Dennis, 15 years, 5 months 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, 15 years, 5 months 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
Re: Error: File upload error (unknown error code). new!
by Anup, 15 years, 3 months ago
Thanx..Reply