react-simple-file-input icon indicating copy to clipboard operation
react-simple-file-input copied to clipboard

Same file upload

Open Dipen-Dedania opened this issue 7 years ago • 2 comments

<FileInput name="myImages" accept=".png,.gif, .jpeg" className="chat-file-upload" placeholder="Upload Image" onChange={this.uploadFileToChat} multiple readAs='binary' > </FileInput>

If you try to upload same file again then it won't detect onChange event. Can you please add some method like ClearInput which will clear this input value?

Thanks!

Dipen-Dedania avatar Apr 13 '18 06:04 Dipen-Dedania

Hi @Dipen-Dedania, thanks for the suggestion.

I think that's a good idea, but I am a little over committed at the moment, maintaining other packages. I am happy to review a PR if you want to have a go at adding one.

greena13 avatar Apr 13 '18 06:04 greena13

I haven't fully tested this, but if you add value='' to the <FileInput> tag, it will allow you to repeat the same upload, as long as the component re-renders after the upload.

RossMetacraft avatar Apr 19 '18 17:04 RossMetacraft