onChange(e) {
const file = e.target.files[0];
Storage.put('example.png', file, {
contentType: 'image/png'
})
.then (result => console.log(result))
.catch(err => console.log(err));
}
imageupload.html
<input type="file" accept='image/png' onChange={(evt) => this.onChange(evt)}/>
So the following code is in react.How can I write the following code in an angular 6 HTML file? Mainly how to write thisonChange={(evt) => this.onChange(evt)}
part in HTML?
For see the original code: https://docs.amplify.aws/lib/storage/upload/q/platform/js#browser-uploads