Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Large file upload - Request gets cancelled

Tags:

I am trying to upload video files of size 40-50mb. The progress bar freezes at a certain point and if i observe in my Networks tab on Google Chrome. The request gets cancelled and there is no error and the HTTP response header is empty.

However this is working for both image/video files which are around 10-15mb.

My code:

Dropzone.autoDiscover = false; var myDropzone = new Dropzone("#my-awesome-dropzone", {         maxFiles: 1,         parallelUploads: 100,         acceptedFiles: '.3gp,.3gp2,.h261,.h263,.h264,.jpgv,.jpm,.jpgm,.mp4,.mp4v,.mpg4,.mpeg,.mpg,.mpe,.m1v,.m2v,.ogv,.qt,.mov,.fli,.flv,.mks,.mkv,.wmv,.avi,.movie,.smv,.g3,.jpeg,.jpg,.jpe,.png,.btif,.sgi,.svg,.tiff,.tif',         previewTemplate: previewTemplate,         previewsContainer: "#previews",         autoProcessQueue: false,         clickable: ".fileinput-button",     }); 

P.S: It is not a server side issue as i have tried uploading without Dropzone and everything works smoothly.

like image 670
Daniyal Arshad Avatar asked Jun 13 '17 03:06

Daniyal Arshad


People also ask

How do I handle a large upload?

Possible solutions: 1) Configure maximum upload file size and memory limits for your server. 2) Upload large files in chunks. 3) Apply resumable file uploads. Chunking is the most commonly used method to avoid errors and increase speed.


1 Answers

Did you use dropzone.js version >= 4.4.0 and ajax request?

If so, you must set the timeout (in ms) in your configuration. It's specify timeout value for xhr (ajax) request, and default value only 30s.

Source: http://www.dropzonejs.com/#configuration

like image 180
yahyaman Avatar answered Sep 21 '22 07:09

yahyaman