akashBhardwaj
akashBhardwaj

Reputation: 159

PHP dropzone issue with post max size

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

Upvotes: 0

Views: 2858

Answers (1)

akashBhardwaj
akashBhardwaj

Reputation: 159

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/

Upvotes: 1

Related Questions