How to access tmp files of a space?

Greetings,

I have a space running on huggingface, it saves an image but I don’t know how to access the save image like the url of it. I tried: https://huggingface.co/spaces/tommy24/classifier/file=/tmp/{filename}
but it doesn’t work. Please help me out.

Thank you

hi @anon85546878 ,

You probably want to access the file param via the subdomain app. Please try

https://tommy24-classifier.hf.space/file=/tmp/{filename}

Facing this error: {“detail”:“File not allowed: /tmp/image.png.”}

Even though the file has been saved, This happens to all the files.

Please help me out.

Facing the same error: {“detail”:“File not allowed: /tmp/upload/saved_image.jpg.”}
@radames

hi @tommy24 and @anon85546878 accessing files via the file/ route is very Gradio specific and it also depends on your app implementation. A few notes to consider, have a look at allowed paths on Gradio docs, make sure the temp file you’re creating is not removed before accessing it via the file/ route

Still not working. Shall I share the code snippet with you? Is it possible for you to look into it and help me solve the issue that I’m facing right now.

Please, if you can make your Space public and create a minimal, reproducible example, thanks