# Streamlit File Uploader not working within Hugging Face Space

**URL:** <https://discuss.huggingface.co/t/streamlit-file-uploader-not-working-within-hugging-face-space/163318>\
**Category:** Beginners\
**Created:** [July 16, 2025, 3:58pm UTC](https://discuss.huggingface.co/t/streamlit-file-uploader-not-working-within-hugging-face-space/163318 "2025-07-16T15:58:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![benchan1](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@benchan1](https://discuss.huggingface.co/u/benchan1)\
**Post date:** [July 16, 2025, 3:58pm UTC](https://discuss.huggingface.co/t/streamlit-file-uploader-not-working-within-hugging-face-space/163318/1 "2025-07-16T15:58:48Z")

</div>

Hi everyone,

I’m using a Hugging Face Docker Space built mainly with Streamlit components. Most components work, but the

`file_uploader`

isn’t functioning. It appears, but dropping a file doesn’t trigger any action—no errors or log messages. It was working before with Streamlit SDK Spaces. Has anyone else faced this issue or have suggestions?

Thanks

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [July 16, 2025, 11:32pm UTC](https://discuss.huggingface.co/t/streamlit-file-uploader-not-working-within-hugging-face-space/163318/2 "2025-07-16T23:32:46Z")

</div>

Perhaps this case?

> <https://github.com/huggingface/huggingface_hub/issues/1496>
>
> \### Describe the bug
> 
> When I use the last supported streamlit version 1.21.0 i…n Docker, I get permission errors when uploading files through a streamlit file uploader.
> 
> This is different from the cache access issue (permissions) because that can be solved by following the guide \[here\](https://huggingface.co/docs/hub/spaces-sdks-docker#permissions). Unfortunately I followed that guide but the problem persists
> 
> By the way, a secondary issue: default Streamlit version according to the \[changelog\](https://huggingface.co/docs/hub/spaces-changelog) is 1.21.0 but the code snippet \[here\](https://huggingface.co/docs/hub/spaces-sdks-streamlit) still says the latest supported version is 1.17.
> 
> \### Reproduction
> 
> The issue can also be reproduced in \[this cloned official DockerTemplates example\](https://huggingface.co/spaces/BramVanroy/streamlit-docker-example) where I just added a file upload button. As you can see, uploading fails.
> 
> Another example: try uploading a file here on this space: https://huggingface.co/spaces/BramVanroy/streamlit-tester
> 
> It should fail with this error message:
> 
> \> AxiosError: Request failed with status code 403
> 
> This is what the Dockerfile looks like:
> 
> \`\`\`docker
> FROM ubuntu:latest
> ENV DEBIAN\_FRONTEND=noninteractive
> RUN apt-get -y update \\
> && apt-get -y install build-essential curl git software-properties-common
> 
> RUN add-apt-repository ppa:deadsnakes/ppa \\
> && apt-get -y update \\
> && apt-get -y install python3.9 python3.9-dev python3-pip python3.9-distutils
> 
> RUN ln -s /usr/bin/python3.9 /usr/bin/python \\
> && rm -rf /var/lib/apt/lists/\*
> 
> RUN useradd -m -u 1000 user
> USER user
> ENV HOME /home/user
> ENV PATH $HOME/.local/bin:$PATH
> 
> WORKDIR $HOME/app
> COPY --chown=user . $HOME/app
> 
> RUN python -m pip install --no-cache-dir --upgrade pip && python -m pip install --no-cache-dir -r $HOME/app/requirements.txt
> 
> EXPOSE 7860
> CMD streamlit run app.py --server.port 7860
> \`\`\`
> 
> \### Logs
> 
> \`\`\`shell
> No meaningful logs in the Container logs that are related to this issue
> \`\`\`
> 
> 
> \### System info
> 
> \`\`\`shell
> \- ubuntu:latest
> \- python 3.9
> \- streamlit 1.21.0
> \`\`\`

> Unfortunately, as you said, we have to set `--server.enableXsrfProtection=false` when using Streamlit on the HF Spaces due to its design.  
> Actually the official non-Docker Streamlit SDK also disables the XSRF protection on the Spaces for this reason.
