Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finish of Multiple file upload

I have a question about the use of Blueimp jQuery-File-Upload plugin (https://github.com/blueimp/jQuery-File-Upload)

There is a callback function or an alternative method, to know when is finished an upload of multiple files? I do not want to know when is finished the upload of every single file, but when is finished the entire process (All Uploads Complited).

There is also the opportunity to know how many files have actually been loaded and how many they were requested?

like image 382
user2381742 Avatar asked Sep 26 '13 10:09

user2381742


People also ask

How does multipart file upload work?

Multipart upload allows you to upload a single object as a set of parts. Each part is a contiguous portion of the object's data. You can upload these object parts independently and in any order. If transmission of any part fails, you can retransmit that part without affecting other parts.

What is multiple file selection?

When you set the Multiple file selection, the user can select more than one file from the File Upload dialog box by holding the Ctrl key or they can click on a file, then hold Shift down, and click on another file so all the files between them are selected(Apple computers support this using the Command key).

How do I select multiple files using file upload control?

The FileUpload. AllowMultiple property in . NET 4.5 and higher will allow you the control to select multiple files.

What is the file upload feature?

This file upload feature can help the users upload a single or multiple files at a time. The multiple files can be few in number or in thousands. Furthermore, they can be very large in size.

How do I upload multiple files in CommonFloor?

In case of Commonfloor, you can select just one file at a time in the File Browser popup and upload it. To upload another file you have to use the Choose File button of the second field. In contrast Gmail allows you to upload multiple files in a single go.

How to upload multiple files in one upload form?

HTML 5 version - Allow you to upload multiple files in one upload form or using drag and drop functionality ( https://github.com/valums/file-uploader ). This widget makes possible to drag and drop multiple files and instantly start the upload process. The files are stored on temporary entities, has a timer to delete the files.

How many arguments does uploadfiles () function take?

fileUploader.uploadFiles () function takes 5 arguments. 1. API endpoint 2. API file key 3. An array of the File object (Files to be upload) 4.


1 Answers

Yes, you can call it API to track the end of a multiple upload process:

var $fileInput = $('#fileupload');

$fileInput.on('fileuploaddone', function(e, data) {
    var activeUploads = $fileInput.fileupload('active');
    /*
     * activeUploads starts from the max number of files you are uploading to 1 when the last file has been uploaded.
     * All you have to do is doing a test on it value.
     */
    if(activeUploads == 1) {
        console.info("All uploads done");
        // Your stuff here
    }
}
like image 148
BoCyrill Avatar answered Oct 18 '22 20:10

BoCyrill