Skip to content

Instantly share code, notes, and snippets.

@mjzone
Last active June 24, 2020 17:12
Show Gist options
  • Save mjzone/a3a1f768ba753418cd9c78b83d8fde09 to your computer and use it in GitHub Desktop.
Save mjzone/a3a1f768ba753418cd9c78b83d8fde09 to your computer and use it in GitHub Desktop.
public access level
// The default access level of the uploads is "public"
const handleChange = async (e) => {
const file = e.target.files[0];
await Storage.put('picture.jpg', file, {
contentType: 'image/jpg'
});
}
// 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