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

Accepted filetypes parameter in FileDropper component does not support file extensions #7373

Closed
1 task done
jurriaanpro opened this issue Oct 8, 2024 · 2 comments
Closed
1 task done

Comments

@jurriaanpro
Copy link

ALL software version info

Software Version Info
panel v1.5.2
python 3.11.8

FilePond 4.31.4 is retrieved when loading component (not sure if relevant)

Description of expected behavior and the observed behavior

Panel docs state that it should be possible to specify file extension in the accepted_filetypes parameter of the FileDropper component. However, when specifying .txt and dropping a file example.txt, the error as seen in the screenshot below shows.

The underlying FilePond library seems to be only supporting mime types. See https://pqina.nl/filepond/docs/api/plugins/file-validate-type/#properties

I guess that either Panel docs is invalid or that code needs to be updated to transform specified extensions into MIME types.

Complete, minimal, self-contained example code that reproduces the issue

import panel as pn

file_dropper = pn.widgets.FileDropper(accepted_filetypes=[".txt"])

file_dropper

Screenshots or screencasts of the bug in action

Screenshot 2024-10-08 at 11 36 19

  • I may be interested in making a pull request to address this in case its a documentation issue.
@ahuang11
Copy link
Contributor

ahuang11 commented Oct 8, 2024

Thanks for reporting this! I believe this is a duplicate of #7153

@jurriaanpro
Copy link
Author

Closed as duplicate of #7153

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants