Last active
August 29, 2015 14:05
-
-
Save alecguintu/971eb66d020803b2d9c3 to your computer and use it in GitHub Desktop.
Filepicker pickMultiple -> store -> remove
This file contains hidden or 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
filepicker.pickMultiple picker_options, (pick_fpfiles) -> | |
for pick_fpfile, i in pick_fpfiles | |
sanitized_filename = sanitize_filename(pick_fpfile.filename) | |
filepicker.store pick_fpfile, store_options, (store_fpfile) -> | |
# Remove files from both fp.io and our root s3 path | |
# Here's where the problem happens. pick_fpfile is always the last from the list of pick_fpfiles since filepicker.store is asynchronous and pick_fpfile has already changed by the time the filepicker.remove's success callback has returned | |
filepicker.remove pick_fpfile, {policy: security.policy, signature: security.signature} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment