Single file upload doesn't update if picking the same file again #1214

Open
opened 2022-05-23 12:52:23 +00:00 by thomashardwick · 0 comments
thomashardwick commented 2022-05-23 12:52:23 +00:00 (Migrated from github.com)

If using ng2FileSelect but only uploading a single file (i.e.multiple attribute on the input element). If you pick a file, edit it and pick it again then the file is still referring to the old version. This then causes the upload to fail.

This is because the input does not fire it's change event because it is still the same file. It seems this was handled but only when the multiple attribute is present.
My solution has been to add (onFileSelected)="upload.value = ''" to the input element.

If using ng2FileSelect but only uploading a single file (i.e.`multiple` attribute on the input element). If you pick a file, edit it and pick it again then the file is still referring to the old version. This then causes the upload to fail. This is because the input does not fire it's `change` event because it is still the same file. It seems this was handled but only when the `multiple` attribute is present. My solution has been to add `(onFileSelected)="upload.value = ''"` to the input element.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#1214