Open Jocelyne-Smith opened 1 month ago
I can't repro the issue with the gr.File
component @Jocelyne-Smith . Anything that's not a .zip
is not allowed by my file picker.
I will take a look separately at the PDF component.
Can't reproduce on the PDF component either!
Hi @freddyaboulton.
Thank you for taking a look so quickly!
My apologies, I should have included more information.
I am running on windows.
First open the file explorer by clicking on 'Click to upload'.
Then click on the dropdown as shown in red. Select 'All Files'.
Select any invalid file type. In my example I uploaded a .jpg in the .zip component.
Heres the code of the component:
submissions_zip_filepath = gr.File(label="Student Solutions (.zip)", type="filepath", file_types=['.zip'], interactive=True)
I was able to upload a .jpg to the component that only accepts .zip file_types. I did not receive any error or warning.
The same issue can be found on the gradio PDF component with the steps as described above.
I uploaded a .jpg in the PDF component.
I did try it on a different PC with the newest gradio and its dependencies.
My apologies I am not sure what the same steps would be on MacOS.
Your help would be really appreciated!
Thank you.
Duplicate of: https://github.com/gradio-app/gradio/issues/8662, I'll actually close https://github.com/gradio-app/gradio/issues/8662 since this has more useful context
Gotcha @Jocelyne-Smith - looks like its a windows issue then!
Describe the bug
When using 'click to upload' on a gradio File component, a user is able to select files that are not specified in the file_types=[]. Similarly a user can upload a non-PDF file when using the 'click to upload' for the gradio PDF component. The same 'Invalid file type only x allowed' error should probably be displayed when a user tries to upload an invalid file type.
Have you searched existing issues? 🔎
Reproduction
Screenshot
Logs
No response
System Info
Severity
I can work around it