Dropzone.js - Chunked file upload

时间:2018-04-20 00:43:44

标签: angularjs dropzone.js chunked

Currently when parallelChunkUploads is set to true, all the chunks are getting uploaded at the same time. If the file size is 6GB and the chunk size is 10MB, 600 chunks are getting uploaded at the same time. Is there a way to control the number of parallel uploads?

Configuration:
chunking: true,
chunkSize: 10000000,
forceChunking: true,
retryChunks: true,
retryChunksLimit: 3,
parallelUploads:1,
parallelChunkUploads: true

1 个答案:

答案 0 :(得分:-2)

Take a look at Dropzone.js docs http://www.dropzonejs.com/#config-parallelUploads

As explained in docs you can manage a queue setting the autoProcessQueu to false.

Enqueuing file uploads

When a file gets added to the dropzone, its status gets set to Dropzone.QUEUED(after the accept function check passes) which means that the file is now in the queue. If you have the option autoProcessQueueset to true then the queue is immediately processed, after a file is dropped or an upload finished, by calling.processQueue() which checks how many files are currently uploading, and if it’s less than options.parallelUploads, .processFile(file) is called. If you set autoProcessQueue to false, then .processQueue() is never called implicitly. This means that you have to call it yourself when you want to upload all files currently queued.