Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload really big files #13

Closed
perryflynn opened this issue Jul 15, 2013 · 4 comments
Closed

Upload really big files #13

perryflynn opened this issue Jul 15, 2013 · 4 comments

Comments

@perryflynn
Copy link

Hi Ivan,

i try to upload files >3GB.

My problem is the max_execution_time of PHP.
After x secounds the upload will abort by the backend.

Have you any suggestion to solve this problem?
Maybe a chunked upload?

My source code:
Backend: https://github.com/agentp/webshelf-file-explorer/blob/master/lib/controller/filesystemcontroller.php#L179
Frontend: https://github.com/agentp/webshelf-file-explorer/blob/master/app/view/UploadWindow.js#L19

I think setting the execution time of php to 2 hours or more is not a good idea.

@ivan-novakov
Copy link
Owner

Are you sure, that the max_execution_time limit is the problem? I tried to upload a larger file at the demo site and it took several minutes. The upload was successfull, although the max_execution_time is 30 seconds.

The PHP docs say that stream operations are not counted towards the max_execution_time limit (http://php.net/manual/en/function.set-time-limit.php).

Anyway, if this is really the problem in your environment, there are two options:

  • to raise the limit
  • to use more appropriate backend like node.js for example

@perryflynn
Copy link
Author

I have found the solution.
My webserver (nginx) have a timeout for fastcgi connections.

http {
   fastcgi_connect_timeout 60;
   fastcgi_send_timeout 3600;
   fastcgi_read_timeout 3600;
}

Solved. :-)

@perryflynn
Copy link
Author

Another required option:

http {
   client_max_body_size 20000M;
}

@ivan-novakov
Copy link
Owner

Good job :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants