Last active
August 29, 2015 14:01
-
-
Save rnicholus/3066f37594a6aefcd575 to your computer and use it in GitHub Desktop.
process submitted files, and only upload the processed versions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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