From 78d299dd2682c223a3a4d8e1f46584fd0f4e10bf Mon Sep 17 00:00:00 2001 From: Neeraj Baid Date: Fri, 8 May 2015 19:00:06 -0700 Subject: [PATCH] Handle onChange event and upload file. --- lib/components/UploadPage.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/components/UploadPage.js b/lib/components/UploadPage.js index 8876392..64ff47b 100644 --- a/lib/components/UploadPage.js +++ b/lib/components/UploadPage.js @@ -36,6 +36,13 @@ export default class UploadPage extends React.Component { UploadActions.uploadFile(file) } + handleSelectedFile(event) { + let files = event.target.files; + if (files.length > 0) { + UploadActions.uploadFile(files[0]); + } + } + render() { switch (this.state.status) { case 'ready': @@ -50,7 +57,7 @@ export default class UploadPage extends React.Component {

Drag the file into this window to get started.

Or .