Streamlit File Uploader on iPad not working when taking photos, but works fine with gallery uploads

App Environment:
Deployment: Running locally on iPad (iOS)
Streamlit Version: 1.35.0

Description of the Issue:
I’m using the st.file_uploader component in my Streamlit app on an iPad. The uploader works perfectly when selecting images from the photo gallery, but it does not work when I try to take a photo directly using the camera. When I click on the uploader button, I get 3 options, Photo Library, Take Photo and Choose File. After going into the Take Photo option, the app opens the iPad camera. The weird thing here is after opening of the camera, if I click the picture within 2s then it uploads successfully but otherwise it fails without even giving me any error on the app or the logs.

Workarounds Attempted:
Browser Testing: I’ve tried different browsers (Safari, Chrome) on my iPad, but the issue persists across all.
Permission Settings: Verified that the browser has proper camera permissions enabled.
I have switched to the st.camera_input module for the time being but the image quality is poor and we would want to switch back to the file_uploader.

Has anyone else encountered this issue, and if so, were you able to find a workaround? Is there a potential fix or update in Streamlit that could address this problem?

Thank you for your help!

I have same issue with Iphone "Take Photo "
st.file_uploader does not upload file but works when browse from gallery.

Seems it is safari issue - works on chrome/Iphone

Thank you for your reply. I tried in both browsers but I am still facing the same issue across browsers.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.