Panel manual resolve and get uploaded files


#1

Hi,
I removed the add button from the panel, and I manually call the resolve function.

// This is the dialog
const dialog = uploadcare.openPanel('#uploader-placeholder', null, {
            multiple: true,
            doNotStore: true,
            tabs: ['file', 'gdrive', 'dropbox']
        });

// This is the resolve call on form submit
dialog.resolve()

uploader.done(function (result) {
    // Here the result.files() is a promise also, so I dont understand how to get the files ids.
})

#2

Hey,

you have to resolve that promise as well.
For example, like this:

$.when.apply(null, result.files()).then(function() {
  arguments; // array of individual file infos
  $.each(arguments, function() {
    console.log(this.cdnUrl); // URL of uploaded file
    console.log(this.uuid); // UUID of uploaded file
  });
});