Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File upload ['ERROR']= 2 [closed]

Tags:

php

I keep getting the file upload error 2, I know this means the file is bigger than the MAX_FILE_SIZE I set in the HTML form, but it is not. It is only 32kb when I set the MAX_FILE_SIZE value="100000". Why would I get this error? I already checked the upload file size and post upload settings in my php.ini and that is not the problem either.

<form enctype="multipart/form-data" method="post" action="upload_img.php">
<input type="hidden" name="MAX_FILE_SIZE" value="100000"/>
<input type="text" name="name" value=""/>
<input type="file" name="picture" value="picture"/>
<input type="submit" name="submit" value="upload"/>
</form>
like image 894
user1174762 Avatar asked Mar 19 '12 23:03

user1174762


1 Answers

Remove this:

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

And in input "picture" set empty value:

<input type="file" name="picture" value=""/>
like image 148
BelKoD Avatar answered Oct 12 '22 22:10

BelKoD