I'm trying to download a PDF file from an S3 bucket. My best guess for how to do that was the following syntax:
import streamlit as st
from st_files_connection import FilesConnection
conn = st.experimental_connection("s3", type=FilesConnection)
with conn.open(
"my-s3-bucket/path/to/file.pdf",
mode="rb",
) as file:
st.download_button(
label="📥 Download (PDF)",
data=file,
file_name="my_file.pdf",
mime="application/pdf",
key="download-pdf",
)
But I'm getting a RuntimeError: Invalid binary data format: <class 's3fs.core.S3File'>
Anything I'm doing wrong or is this functionality just not supported yet?
I'm trying to download a PDF file from an S3 bucket. My best guess for how to do that was the following syntax:
But I'm getting a
RuntimeError: Invalid binary data format: <class 's3fs.core.S3File'>Anything I'm doing wrong or is this functionality just not supported yet?