Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileDropper accepted_filetypes doesn't seem to properly validate #7153

Open
ahuang11 opened this issue Aug 15, 2024 · 5 comments
Open

FileDropper accepted_filetypes doesn't seem to properly validate #7153

ahuang11 opened this issue Aug 15, 2024 · 5 comments
Labels
type: bug Something isn't correct or isn't working
Milestone

Comments

@ahuang11
Copy link
Contributor

import panel as pn

pn.extension()

self._file_input = pn.widgets.FileDropper(
    multiple=True,
    accepted_filetypes=[".csv", ".parquet", ".parq", ".json", ".xlsx"],
)
image
@ahuang11 ahuang11 added the TRIAGE Default label for untriaged issues label Aug 15, 2024
@philippjfr philippjfr added type: bug Something isn't correct or isn't working and removed TRIAGE Default label for untriaged issues labels Aug 16, 2024
@philippjfr philippjfr added this to the v1.5.0 milestone Aug 16, 2024
@hoxbro
Copy link
Member

hoxbro commented Aug 16, 2024

What happens if you pass in without the dots? E.g. csv instead of .csv.

@ahuang11
Copy link
Contributor Author

Still fails

import panel as pn

pn.extension()

pn.widgets.FileDropper(
    multiple=True,
    accepted_filetypes=["csv", "parquet", "parq", "json", "xlsx"],
).show()
image

@philippjfr
Copy link
Member

Seems like a problem with Filepond itself: pqina/filepond-plugin-file-validate-type#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.

@CyberQin
Copy link

This problem is still exists when v1.5.0 published.

@MarcSkovMadsen
Copy link
Collaborator

To solve this problem for our users we could convert know file suffixes to mime types.

@philippjfr philippjfr modified the milestones: v1.5.3, Version 1.5.4 Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

No branches or pull requests

5 participants