panel
panel copied to clipboard
FileDropper accepted_filetypes doesn't seem to properly validate
import panel as pn
pn.extension()
self._file_input = pn.widgets.FileDropper(
multiple=True,
accepted_filetypes=[".csv", ".parquet", ".parq", ".json", ".xlsx"],
)
What happens if you pass in without the dots? E.g. csv instead of .csv.
Still fails
import panel as pn
pn.extension()
pn.widgets.FileDropper(
multiple=True,
accepted_filetypes=["csv", "parquet", "parq", "json", "xlsx"],
).show()
Seems like a problem with Filepond itself: https://github.com/pqina/filepond-plugin-file-validate-type/issues/13
Problem is that it passes the accept keyword down to the DOM node, which does support file extensions but the FilePond validation logic itself expects mime types.
This problem is still exists when v1.5.0 published.
To solve this problem for our users we could convert know file suffixes to mime types.