This repository was archived by the owner on Oct 8, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +5
-20
lines changed Expand file tree Collapse file tree 4 files changed +5
-20
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,6 @@ npm install react-file-reader --save
1414```
1515
1616## ChangeLog
17- - 1.0.4
18- - adds the ability to return both base64 strings and an HTML5 FileList from handleFiles
1917 - 1.0.3
2018 - bumps React version to 15.5 and fixes UNMET peer dependency with webpack
2119 - 1.0.2
@@ -87,18 +85,5 @@ handleFiles = files => {
8785 "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA..."
8886```
8987
90- ### Both Base64 and HTML5 FileList
91- ``` javascript
92- handleFiles = (base64Files , fileList ) => {
93- console .log (base64Files);
94- console .log (fileList);
95- }
96-
97- < ReactFileReader base64= {true } multipleFiles= {true } handleFiles= {this .handleFiles }>
98- < button className= ' btn' > Upload< / button>
99- < / ReactFileReader>
100- ```
101- When ` base64={true} ` , ` handleFiles ` will return both the Base64 string and the HTML5 FileList object.
102-
10388## Copyright
10489Copyright (c)2017 [ Grillwork Inc] ( http://grillwork.io ) . See [ LICENSE] ( https://github.com/GrillWork/react-file-reader/blob/master/LICENSE ) for details.
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ export default class ReactFileReader extends React.Component {
3535 files . push ( reader . result )
3636
3737 if ( files . length === ef . length ) {
38- this . props . handleFiles ( files , ef ) ;
38+ this . props . handleFiles ( files ) ;
3939 }
4040 }
4141
@@ -46,7 +46,7 @@ export default class ReactFileReader extends React.Component {
4646 let reader = new FileReader ( ) ;
4747
4848 reader . onloadend = function ( e ) {
49- this . props . handleFiles ( reader . result , ef )
49+ this . props . handleFiles ( reader . result )
5050 } . bind ( this )
5151
5252 reader . readAsDataURL ( f )
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ var ReactFileReader = function (_React$Component) {
6969 files . push ( reader . result ) ;
7070
7171 if ( files . length === ef . length ) {
72- _this . props . handleFiles ( files , ef ) ;
72+ _this . props . handleFiles ( files ) ;
7373 }
7474 } ;
7575
@@ -85,7 +85,7 @@ var ReactFileReader = function (_React$Component) {
8585 var _reader = new FileReader ( ) ;
8686
8787 _reader . onloadend = function ( e ) {
88- this . props . handleFiles ( _reader . result , ef ) ;
88+ this . props . handleFiles ( _reader . result ) ;
8989 } . bind ( _this ) ;
9090
9191 _reader . readAsDataURL ( f ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " react-file-reader" ,
3- "version" : " 1.1.0 " ,
3+ "version" : " 1.0.3 " ,
44 "description" : " A flexible ReactJS component for handling styled HTML file inputs." ,
55 "main" : " index.js" ,
66 "repository" :
" [email protected] :GrillWork/react-file-reader.git" ,
You can’t perform that action at this time.
0 commit comments