JasonGenX
JasonGenX

Reputation: 5434

$.ajax file upload timeouts with large files

I have a PHP application running on NGINX web server. We discovered a problem where large files cause an $.ajax timeout when uploaded. I was told the $.ajax timeout values will not help as this is a browser vs. server issue. Is there practice that's common to resolve this issue?

Upvotes: 2

Views: 1825

Answers (1)

JasonGenX
JasonGenX

Reputation: 5434

It seems I was fed wrong information. This was NO timeout. It was an HTTP Error 413 Request entity too large.

Adding this to the NGINX configuration file:

client_max_body_size 100M;

and these to /etc/php5/fpm/php.ini:

post_max_size = 12M
upload_max_filesize = 10M

resolved the issue.

Upvotes: 2

Related Questions