1. I have a form to upload a file of size more than the limit specified in php.ini(Say 2MB)
2. I have created a php.ini in the same directory to overwrite the specifications in the directory.(say 12MB)
3. I have created an upload form and tried to upload the file a file of higher size(say 5MB)
4. I get an error 2 ($_FILES['uploadedfile']['error'])
How do i resolve this problem?
file upload problem
Moderator: General Moderators
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: file upload problem
In the php.ini file there are a few locations you need to modify.
Something like this...
upload_max_filesize
post_max_size
Something like this...
upload_max_filesize
post_max_size
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: file upload problem
Do you have enctype="multipart/form-data" in your form tag?
Re: file upload problem
yes i did..
and i think i found out the problem.
in the uploading form i had a hidden field
This was initially put for verification on client side. But i see that the latest php versions also check for this field by default and if the uploaded file exceeds this limit, it will bounce back this error.
And FYI , i have increased both the max_file_size as well as the post data maximum size to 20MB. So no issues there.
and i think i found out the problem.
in the uploading form i had a hidden field
Code: Select all
<input type="hidden" name="MAX_FILE_SIZE" value=1000000/> And FYI , i have increased both the max_file_size as well as the post data maximum size to 20MB. So no issues there.