Skip to content

Timeout on Android Chrome Browser for st.file_uploader, cant upload file #11419

@adamp87

Description

@adamp87

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

The st.file_uploader widget on mobile phones exhibits a timeout issue specifically when tested on Android using the Chrome browser. If there is a delay (e.g., around 15 seconds) after opening a file selection application and before selecting a file, the widget fails to upload properly. The issue can be reproduced using the example provided in the official documentation:
Streamlit File Uploader Documentation.

Reproducible Code Example

# use official demo
# https://docs.streamlit.io/develop/api-reference/widgets/st.file_uploader

import streamlit as st

uploaded_files = st.file_uploader(
    "Choose a CSV file", accept_multiple_files=True
)
for uploaded_file in uploaded_files:
    bytes_data = uploaded_file.read()
    st.write("filename:", uploaded_file.name)

Open in Streamlit Cloud

Steps To Reproduce

  • Open a mobile browser on an Android device (tested with Chrome).
  • Visit the official Streamlit documentation for st.file_uploader:
  • URL: https://docs.streamlit.io/develop/api-reference/widgets/st.file_uploader.
  • Scroll down to the example for st.file_uploader.
  • On the widget, click the "Browse files" button, which prompts Android to ask which application to use.
  • Select any file management app (e.g., Samsung's File Browser) but wait for 15 seconds before choosing a file.
  • Select a file from the file manager app and confirm.

Expected Behavior

On mobile phone, after selecting the file in the file manager app, the uploaded file name should appear in the Streamlit app, as expected.

Current Behavior

  • On mobile phone, when waiting 15 seconds before selecting the file, the Streamlit app shows "connecting" after selecting the file and then fails to display the uploaded file name.
  • On mobile phone, if a file is selected immediately without delay, the widget works as expected, file name is displayed, and no timeout occurs.

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Device: Samsung S24
  • OS: Android 15.0
  • Browser: Chrome 136.0.7103.125
  • Python version: 3.10
  • Streamlit Version: 1.45.0
  • Internet Connection: Stable WiFi during testing.

Additional Information

  • This issue seems time-sensitive and suggests a possible timeout behavior when Android switches between File Manager App and the Browser.
  • No issues observed on desktop browsers with the same testing process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature:st.file_uploaderRelated to the `st.file_uploader` widgetpriority:P3Medium prioritystatus:confirmedBug has been confirmed by the Streamlit teamtype:bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions