There is a strange behaviour in LWC File Upload component.
There are two ways how files can be uploaded through this component.
The user can:
- Select a file on your system by clicking the button to open the system's file browser
- Drag a file from your system into the file selector dropzone
If the user uses the first way, the accept
format filter works well, only accepted file formats are allowed.
If the user uses the second way, however, the accept
format doesn't have effect, and user can still upload a file which doesn't conform to the accepted file formats.
So, if we set file format to .pdf
and .xlsx
, the user cannot select .xls
file in the file browser but can upload .xls
file by using drag and drop feature.
Is there a simple UI workaround for this? Is this a platform bug? How this can be resolved?