Skip to content

Instantly share code, notes, and snippets.

@rnicholus
Last active August 29, 2015 14:01
Show Gist options
  • Save rnicholus/3066f37594a6aefcd575 to your computer and use it in GitHub Desktop.
Save rnicholus/3066f37594a6aefcd575 to your computer and use it in GitHub Desktop.
process submitted files, and only upload the processed versions
function process(file) {
var processedVersion = /*do stuff and return a processed version */
processedVersion.processedByMyApp = true;
uploader.addBlobs(processedVersion);
}
var uploader = new qq.FineUploader({
request: {
endpoint: "/uploads"
},
callbacks: {
onSubmit: function(id) {
var file = this.getFile(id);
if (!file.processedByMyApp) {
process(file);
return false;
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment