How to reset ReactJS file input

后端 未结 10 1068
傲寒
傲寒 2020-12-29 00:55

I have file upload input:


And I handle upload t

10条回答
  •  感动是毒
    2020-12-29 01:34

    This work for me - ref={ref => this.fileInput = ref}

     this._handleFileChange(e)} ref={ref=> this.fileInput = ref} />
    

    then in my case once the file was uploaded to the server , I clear it by using the statement below

     this.fileInput.value = "";
    

提交回复
热议问题