carbon-componentscarbon-components-reactI have a fileUploader and I want to get access to the selected file :
handleImportProject(fileUploader) {
console.log("Files: ", fileUploader.nodes[0])
//ApiService.importProject(this.state.projectName, file.nodes[0])
//this.toggleImportProjectModal(false)
}
How can I achieve that?
I was missing : onChange={e => this.handleFileChanged(e)
handleFileChanged(e) {
//console.log("File: ", e.target.files[0])
this.setState({selectedFile: e.target.files[0]})
}
Most helpful comment
I was missing : onChange={e => this.handleFileChanged(e)