ivan-novakov / extjs-upload-widget

File upload widget for ExtJS v4
80 stars 42 forks source link

Upload really big files #13

Closed perryflynn closed 11 years ago

perryflynn commented 11 years ago

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 commented 11 years ago

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:

perryflynn commented 11 years ago

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 commented 11 years ago

Another required option:

http {
   client_max_body_size 20000M;
}
ivan-novakov commented 11 years ago

Good job :)