简体   繁体   中英

PHP upload MAX_FILE_SIZE error 2

I am trying to use Zend file transfer to upload a file

in php.ini I set:

upload_max_filesize = 20M

post_max_size = 20M

when I try to upload a 1MB file I get error 2 complaining about max_file_size

I tried setting MAX_FILE_SIZE in html as well

<input type="hidden" name="MAX_FILE_SIZE" value="2097152000000" />

but nothing is working

PHP Variables of the Upload request:

_REQUEST["MAX_FILE_SIZE"]  2097152000000

_REQUEST["PHPSESSID"]   b866b7105cb4747497f8744f56a807a0

_POST["MAX_FILE_SIZE"]  2097152000000

_FILES["userfile"]  

Array
(
    [name] => 1mpImage.jpg
    [type] => 
    [tmp_name] => 
    [error] => 2
    [size] => 
)

any idea?

This question comes up now and again and usually the answer is:

In order for the ini changes to become active your apache server would need to be restarted.

If your on windows then run

apache -k restart

alternatively you can just open up services.msc > find apache web server nad right click restart.

Don't use that input:

<input type="hidden" name="MAX_FILE_SIZE" value="2097152000000" />

And you should have

<input type="file" value="">

Value="" that's the point

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM