Skip to content

Instantly share code, notes, and snippets.

@nfriend21
Created September 28, 2013 13:57
Show Gist options
  • Save nfriend21/6742335 to your computer and use it in GitHub Desktop.
Save nfriend21/6742335 to your computer and use it in GitHub Desktop.
$(".cloudinary-fileupload")
.bind('fileuploadprogress', function(e, data) {
console.log('fileuploadprogress')
})
.off("cloudinarydone").on("cloudinarydone", function (e, data) {
console.log('in it')
})
.fileupload({
// Uncomment the following lines to enable client side image resizing and valiation.
// Make sure cloudinary/processing is included the js file
//disableImageResize: false,
//imageMaxWidth: 800,
//imageMaxHeight: 600,
//acceptFileTypes: /(\.|\/)(gif|jpe?g|png|bmp|ico)$/i,
//maxFileSize: 20000000, // 20MB
dropZone: "#direct_upload",
start: function (e) {
$(".status").text("Starting upload...");
},
progress: function (e, data) {
ajaxOverlayUploading("Uploading... " + Math.round((data.loaded * 100.0) / data.total) + "%")
$(".status").text("Uploading... " + Math.round((data.loaded * 100.0) / data.total) + "%");
},
fail: function (e, data) {
$(".status").text("Upload failed");
},
complete: function (e, data) {
$('.ajax-overlay-confirmation').html('Processing...');
$('body').addClass('upload-complete');
console.log('done');
}
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment