I have a component like:
class Media extends Component {
render() {
return (
<form className="uploader" encType="multipart/form-data">
<input type="file" id="file" />
</form>
)
}
}
export default Media
Here I want to upload multiple file . In HTML we can do it like
<input type="file" name="img" multiple>
How can I have multiple value in reactjs ??
Thank you in advance
Update
class Media extends React.Component {
handleChange(e) {
console.log(e.target.value)
}
render() {
return (
<form className="uploader" encType="multipart/form-data">
<input type="file" id="file" multiple onChange={this.handleChange.bind(this)}/>
</form>
)
}
}
ReactDOM.render(
<Media />,
document.getElementById('container')
);
Here if I upload the image and the value is changed I only get first Image how to get all uploaded image ??