Reputation: 61
For some reason file upload is not working for this .ppt
file that I am trying to upload. I have tested it with another ppt file (approximately 250kb) and it worked fine... but this one is 10mb and the $_FILE
array is empty when I echo it. Can you guys tell me what I am doing wrong?? I know my PHP file is right.
index.php:
<form action="http://localhost:80/phpconverter/upload.php" method="post"
enctype="multipart/form-data" target="upload_target">
<input type="hidden" id="MAX_FILE_SIZE" name="MAX_FILE_SIZE"
value="102400000" />
Choose a file to upload:
<input id="fileName" name="uploaded_file" type="file" />
<input type="submit" value="Upload"/>
<iframe id="upload_target" name="upload_target" src="#"
style="width:200px;height:500px;border:0px solid #fff;"> </iframe>
</form>
When checking if the file is empty or not (i.e. empty($_FILES["uploaded_file"]
) I see that the file is empty, when I have in fact uploaded a file!!
Upvotes: 2
Views: 1227
Reputation: 86436
Your file is too big and exceeds the PHP file default limit which is 2MB.
You have to increase upload_max_filesize
and post_max_size
in either php.ini
or .htaccess
file.
Upvotes: 5
Reputation: 51411
but this one is 10mb and the $_FILE array is empty when I echo it
The default PHP configuration places either a 2MB or 8MB limit on uploaded file sizes.
Please refer to the post_max_size
and the upload_max_filesize
configuration settings in your php.ini file. post_max_size
must be equal to or larger than upload_max_filesize
. These settings can not be changed at run-time.
Upvotes: 2