Last active
June 24, 2020 17:13
-
-
Save mjzone/ce1bb32d2e01713e8e3e94aeaa521d07 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
// Set the "level" attribute value to "protected" | |
const handleChange = async (e) => { | |
const file = e.target.files[0]; | |
await Storage.put('picture.jpg', file, { | |
contentType: 'image/jpg', | |
level: 'protected' | |
}); | |
} | |
// HTML | |
<input type="file" accept='image/jpg' onChange={(evt) => handleChange(evt)} /> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment