Description
Hi,
When uploading a file on IE11 (not yet tested on other IE or edge versions) the different parts of the upload need to be in a specific order.
Meaning if you upload a file and add some other information like an ID, the file need to be last in the form data. Nothing is sent after the file.
This looks very much like the known issue of pristine checkboxes being last in a form which are not sent with IE.
I posted the issue on stackoverflow recently.
The quickfix for this is to allow appending data to the FormData object before the file is added to the FormData. Passing the formData object to the upload-before event did the trick for me.
const evt = this.dispatchEvent(
new CustomEvent('upload-before', {
detail: {file, xhr, formData},
cancelable: true
})
);
Before submitting a pull request, I'd like to know if that fix is ok with you. Or if there are specific reasons why the formData was not passed originally for that event.