gradio icon indicating copy to clipboard operation
gradio copied to clipboard

Specific file type upload fails on Gradio 5

Open FrostMegaByte opened this issue 4 months ago • 1 comments

Describe the bug

I added code that allows uploading an Excel file. This works on Gradio version 4.44.1, but not on version 5.

On version 5 an error pop-up appears that mentions that the file upload for the specific file type failed. I uploaded an Excel file and then the error mentions something like only [".xlsx"] files are allowed, which I did upload.

When setting the file types to ["files"] the upload succeeds, but that defeats the purpose of being able to specify specific types.

Have you searched existing issues? 🔎

  • [X] I have searched and found no existing issues

Reproduction

import gradio as gr

file_output = gr.File()
file = gr.UploadButton(
	"Upload Excel file",
	file_count="single",
	file_types=[".xlsx"],
)
file.upload(lambda file: file.name, file, file_output)

Screenshot

No response

Logs

No response

System Info

Windows 10
gradio==5.1.0
python==3.11

Severity

I can work around it

FrostMegaByte avatar Oct 18 '24 07:10 FrostMegaByte