FileUpload does not allow selecting same file #3385
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
I'm submitting a ...
Current behavior
I have defined the component this way
<p-fileUpload #fileUpload accept=".csv,.txt" maxFileSize="1000000" customUpload="true" (uploadHandler)="uploadFile($event)">
on my package Json I have defined
"primeng": "^4.1.0-rc.3"
and have this method on the js file
uploadFile(event) { for (let file of event.files) { this.uploadedFiles.push(file); } this.uploadFileService.doSomething(this.uploadedFiles[0]).subscribe(x => { this.fileInfo = x; ..do some stuff.. }); }
It works as expected the first time (showing the 3 buttons of the component choose, upload and cancel) and letting me to choose the file from the popup window, the thing is, one it finish the process, if I try to upload the same file again It does not allows me to do it. It only allows me to choose the file, but the upload button is never enabled (unless I choose a different file, in that case the upload button is enabled) and of course the uploadfile method is never called. And after that if I choose the same file as the begining it works as expected.
I am using
this.fileUpload.clear();
just for clear the part where the uploaded file it is showed to the user
Thanks
Expected behavior
I think I should allows me to upload the same file.
Minimal reproduction of the problem with instructions
The example showed on http://primefaces.org/primeng/#/fileupload has the same behavior
Please tell us about your environment:
Windows 10, Visual Studio Code
Angular version: 4.0
PrimeNG version: 4.1.0-rc3
Browser: [Chrome XX]
Language: [ ES6/7 | ES5]
The text was updated successfully, but these errors were encountered: