5.15.4

Pause In-Progress Uploads

Summary

Version 4.1 brings the ability to pause (and then continue) in-progress chunked uploads. A paused upload will free up a slot in the connections queue, allowing the next queued file to begin uploading as well. This feature includes new API methods, built-in Fine Uploader UI support (via optional template elements), and a feature support flag. Note that this feature depends on the chunking feature, so chunking must be possible and enabled in the current browser. When a paused upload is continued, it will start at the beginning of the chunk that was in progress when the upload was paused.

Use Cases

This feature mainly compliments the chunking and auto-resume features. For example, while it is not necessary to "pause" an in progress upload to resume it later, it is probably much more intuitive for end users to do so. This feature also provides the ability to upload queued items immediately (or sooner) simply by pausing in-progress uploads that are lower priority.

Fine Uploader UI Support

If you want "pause" and/or "continue" buttons to appear next to your files at the appropriate times, you must add the following to your template:

<button type="button" class="qq-upload-pause-selector qq-upload-pause">Pause</button>
<button type="button" class="qq-upload-continue-selector qq-upload-continue">Continue</button>

These elements must be added under the qq-upload-list-selector container in your template in order for Fine Uploader UI to find them.

You can remove the second CSS class in each element, if you choose. The first CSS class is used internally by Fine Uploader to select the buttons, and the second is used to apply default styles defined in Fine Uploader's CSS file. You can also change the text, omit one or both of these elements, add attributes, or add CSS classes in your template definition.

The pause button will appear next to a file that is in progress if chunking is enabled and at least one chunk has been successfully uploaded. By default, the progress bar will remain visible, the spinner will be hidden, and a "Paused" message will appear to the right of the file. This text can be customized by overriding the default value of the text.paused UI option.

The continue button will appear (and the pause button will be hidden) after a file upload has been paused. The status text will be cleared and the spinner will re-appear at this point. The file will be added to the end of the connections queue, meaning that it will not actually continue until all other files ahead of it in the queue have completed (or have been paused).

Fine Uploader Core Support (API methods)

There are two new API methods: pauseUpload and continueUpload. As with all API methods, these are also available to Fine Uploader UI instances as well. With these, you can programmatically pause an in-progress upload, or continue a paused upload. These methods will return true if the operation succeeds. Note that pausing an upload is only possible if the current browser supports chunking, and if chunking is enabled.