I’m new to Streamlit and would very much appreciate your help! I am building an app that lets users upload images to GCS.
I set up a bucket on GCS and followed the excellent guide in Here to connect my Streamlit app with the bucket.
I’m having trouble uploading the images, though. Is there any way to upload images using Streamlit FilesConnection? The only file formats I could see are text and parquet. Is there a way to take a jpeg image and save it in a parquet format?
I guess using conn.open() with mode="wb" to create the file and then writing the bytes to it should work. You might as well get rid of FilesConnection, since gcsfs already provides that kind of API.
Thanks for answering Goyo! The problem is that, afaiu, the only binary format supported by FilesConnection (using conn.open(), conn.read(), …) is parquet, and I’m not sure how it can help me deal with jpeg images.
One tning I forgot to mention is that I’m using a private bucket on GCS.
Your comment about using direct interface of gcsfs sounds interesting - do you have a good example of how to do that with streamlit?
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.