Skip to content

Commit

Permalink
Merge pull request #1 from gabehollombe/fix-s3imageupload-sample
Browse files Browse the repository at this point in the history
Fix code for sample S3ImageUpload component
  • Loading branch information
gabehollombe authored May 2, 2018
2 parents d5d27d6 + 792bdba commit e4511bd
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions docs/media/storage_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,23 +167,23 @@ Storage.put('test.txt', 'Private Content', {
Upload an image from browser:
```js
class S3ImageUpload extends React.Component {
function 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));
}

render() {
return ()
<input
type="file" accept='image/png'
onChange={(e) => this.onChange(e)}
/>
)
}
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));
}

render() {
return (
<input
type="file" accept='image/png'
onChange={(e) => this.onChange(e)}
/>
)
}
}
```

Expand Down

0 comments on commit e4511bd

Please sign in to comment.