1

We are using the lightning-file-upload LWC in a community and have an issue that is only appearing in IE11.

When a user attempts to upload a file in IE11, independent of file extension, they get an error ('Your company doesn't support the following file types:') if we are providing the accept parameter. If we omit the accept attribute, the file uploads without issue.

Is there any IE11 workaround for the lightning-file-upload component?

LWC HTML:

<div if:false={showSpinner}>
    <lightning-file-upload
            label="Upload up to 10 files"
            name="fileUploader"
            accept={acceptedUploadFormats}
            record-id={recordId}
            onuploadfinished={handleUploadFinished}
            multiple>
    </lightning-file-upload>
</div>

JS:

get acceptedUploadFormats() {
    return ['.pdf', '.xls', '.xlsx'];
}

error screenshot

1

This is because accept is actually comma separated string and not list. By doing below change in JS, it will work:

get acceptedUploadFormats() {
    return '.pdf, .xls, .xlsx';
}

note: I think documentation has some errors - even for other tags, few functionalities are not working as per docs even in chrome browser. You will notice the difference in complex implementations.

1
  • This worked great. Thanks! – Kyle Johnson Nov 20 '19 at 21:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.