Dear CUBA community,
I am trying to get an upload button that allows .docx files and .pdf files to be selected in the file selection dialog. However, when I use the ‘accept’ XML attribute for a FileUploadField (set to *.pdf,*.docx
) to specify these extensions or the corresponding Java method, the file selection dialog only allows pdf files to be selected. When setting the field to just *.docx
, no extension filtering is performed at all. Expected behaviour happens when setting it to e.g. *.pdf
or *.xml
.
How can I get this functionality working for .docx files?
To reproduce:
<vbox spacing="true">
<upload accept="*.pdf" uploadButtonCaption=".pdf (works)"/>
<upload accept="*.xml" uploadButtonCaption=".xml (works)"/>
<upload accept="*.pdf,*.xml" uploadButtonCaption=".pdf and .xml (works)"/>
<upload accept="*.docx" uploadButtonCaption=".docx (does not work)"/>
<upload accept="*.pdf,*.docx" uploadButtonCaption=".pdf and .docx (does not work)"/>
</vbox>