Getting $_FILES array empty for some specific image files

青春壹個敷衍的年華 提交于 2019-12-13 07:47:29

问题


I've following HTML code to upload image file :

<form id="request_form" method="post" enctype="multipart/form-data" action="print.php">
  <input type="file" name="student_image" id="student_image" accept="image/*" capture/>                  
  <button type="submit">Submit</button>
</form>

PHP code is as follows :

<?php
print_r($_FILES);// Here I'm getting blank $_FILES array for few specific image files which are greater than 10 MB in size
?>

Following are the file upload setting from my php.ini file:

upload_max_filesize = 10M

post_max_size = 10M

I'm getting the blank array when I try to upload image files which are greater than 10 MB in size.

Please help me out from this issue.


回答1:


You need to change your php.ini file and set greater value than 10M, it is config for Apache, and Apache doesn't let you to send big image and files before it



来源:https://stackoverflow.com/questions/27401824/getting-files-array-empty-for-some-specific-image-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!