Skip to content

Instantly share code, notes, and snippets.

@dmitry-mukhin
Created January 27, 2015 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmitry-mukhin/4c19434a4e367da2963f to your computer and use it in GitHub Desktop.
Save dmitry-mukhin/4c19434a4e367da2963f to your computer and use it in GitHub Desktop.
var multipleWidget = uploadcare.MultipleWidget("[role=uploadcare-uploader]");
$ = uploadcare.jQuery; // skip this if you already have jQuery on the page
multipleWidget.onChange(function(group) {
if (group) {
group; // group object
group.files(); // array of file objects
$.when.apply(null, group.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
console.log(this.name); // original filename
});
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment