duanrou5680 2015-09-07 13:21
浏览 89
已采纳

发布最大大小的PHP dropzone问题

I am working on a PHP application deployed on a cent os machine having suhosin installed in it. I used dropzone.js with my application and tried to upload a file size more than 20 MB. I configured the ini setting as follows

post_max_size = 200M
max_input_time=600
max_execution_time=300
max_file_uploads=20
upload_max_filesize = 200M
upload_tmp_dir = /custom_dir/tmp

The tmp is writable, apache has been restarted, display_errors is On, ini_get gives the updated values of php.ini.

Error generated by dropzone is Server responded with 0 code.

I tried creating a demo form and uploaded a file size greater than 20 MB it also failed, less than 20MB uploaded working just fine. I thus came to conclusion the error might be fron server side and not from dropzone.

I have reffered Dropzone.js - maxFilesize increase not working, Large File Upload Errors with PHP, 1GB file upload using php, http://www.cyberciti.biz/faq/linux-unix-apache-increase-php-upload-limit/ Still am unable to figure out why it's not working. Can any one help ? I know this seems to be duplicate question but trust me I have tried all the specs still getting the issue

  • 写回答

1条回答 默认 最新

  • douyi6755 2015-09-08 05:38
    关注

    Got it working suhosin was not the issue It was apache's LimitRequestBody in httpd.conf

    To restricts the total size of the HTTP request body sent from the client use LimitRequestBody Directive. You can add this directive using .htaccess file or httpd.conf file under virtual host or directory configuration options. You can set value (in bytes) from 0 (unlimited) to 2147483647 (2GB) that are allowed in a request body.

    Example for LimitRequestBody set to 100k bytes (in httpd.conf)

    LimitRequestBody 102400

    [...] Save and close the file. You need to restart or reload the httpd server as follows:

    service httpd restart

    or

    service httpd reload

    Source: http://www.cyberciti.biz/faq/apache-limiting-upload-size/

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 远程桌面文档内容复制粘贴,格式会变化
  • ¥15 关于#java#的问题:找一份能快速看完mooc视频的代码
  • ¥15 这种微信登录授权 谁可以做啊
  • ¥15 请问我该如何添加自己的数据去运行蚁群算法代码
  • ¥20 用HslCommunication 连接欧姆龙 plc有时会连接失败。报异常为“未知错误”
  • ¥15 网络设备配置与管理这个该怎么弄
  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题