Created
September 10, 2018 12:24
-
-
Save gmac/4f2517bebaabc0d385f48e7bb1330aa9 to your computer and use it in GitHub Desktop.
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
document.querySelector('#file-field').addEventListener('change', (evt) => { | |
uploader.then((evaporate) => { | |
Array.from(evt.target.files).forEach((file) => { | |
evaporate.add({ | |
file, | |
name: file.name, | |
progress: (progressValue) => console.log('Progress', progressValue), | |
complete: (_xhr, awsKey) => console.log('Complete!', awsKey), | |
}).then( | |
(awsObjectKey) => console.log('File successfully uploaded to:', awsObjectKey), | |
(reason) => console.log('File did not upload sucessfully:', reason) | |
); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment