0

I'm facing this issue on 000webhost when I'm trying to upload excel file into database.

here is link of my test site Test site for Excel Sheets

There is a file with name of largedata.xlsx I'm trying to upload this file. Here

It take some time but after this it show error message POST requests, or the amount of data provided in the request exceeds the capacity limit.

I searched about this and already update the post_max_size and upload_max_filesize in .htaccess file you can check info.php for this detail. But still I'm facing this issue.

.htaccess

php_value post_max_size xxM
php_value upload_max_filesize xxM

Replace xx with your value.

Azeem Haider
  • 1,443
  • 4
  • 23
  • 41
  • So what do you want us to do? If the data exceeds the limit the process is killed for security reasons. – arkascha Oct 07 '17 at 09:28
  • About that dynamic configuration file (".htaccess" style file)... Are you certain it is considered at all? You need to enable its interpretation first in your host configuration. Take a look at the `AllowOverride` directive for that in the documentation. – arkascha Oct 07 '17 at 09:30
  • I want to ask is there any problem with my code or it is from hosting provider ??? – Azeem Haider Oct 07 '17 at 09:31
  • We cannot say anything about your post obviously, since we do not know it. But I would not consider this a real problem at all, to me this looks like that system works as intended. – arkascha Oct 07 '17 at 09:33
  • Are you using PHP-FPM? – apokryfos Oct 07 '17 at 09:35
  • @apokryfos yes I think you can check `phpinfo` here https://pakdeveloper.000webhostapp.com/info.php – Azeem Haider Oct 07 '17 at 09:41
  • @arkascha actually I need to insert records into database from excel sheet, this one is a large sheet 16MB how can I do that if post max size increase ? – Azeem Haider Oct 07 '17 at 09:44
  • You are not using PHP-FPM which means the `.htaccess` rules should work as long as you put them in an .htaccess which is the one being used by your page. – apokryfos Oct 07 '17 at 09:59

1 Answers1

0

413 errors occur when the request body is larger than the server is configured to allow. Here’s how you can fix it, depending on your web server:

Apache: Set the LimitRequestBody directive in either your httpd.conf file or a local .htaccess file. (https://stackoverflow.com/a/3719358/1688568)

Nginx: Set the client_max_body_size directive in nginx.conf (http://www.cyberciti.biz/faq/linux-unix-bsd-nginx-413-request-entity-too-large/)

IIS: Set the uploadreadaheadsize config setting (http://blogs.msdn.com/b/jiruss/archive/2007/04/13/http-413-request-entity-too-large-can-t-upload-large-files-using-iis6.aspx)