Custom component to perform chunked upload in Streamlit.
Project description
streamlit-chunk-file-uploader
This is a custom component that allows you to split files and send them from your browser to Streamlit.
Installation instructions
pip install streamlit-chunk-file-uploader
Usage instructions
import streamlit as st
from streamlit_chunk_file_uploader import uploader
file = uploader("uploader", key="chunk_uploader", chunk_size=32)
st.write(file)
if file is not None:
st.download_button(
"download",
data=file,
file_name=file.name,
type="primary",
)
About chunk size
When a file is uploaded, the Python script slices it on the browser side with the specified chunk size and sends it as a binary string through setComponentValue.
In addition to the binary string, setComponentValue also transmits information such as upload mode, file name, and file size to be received by the backend.
Therefore, it is important to note that the chunk size and the size of the request may differ.
In cases where there are constraints such as client_max_body_size, it is necessary to set a value slightly smaller than the constraint size, for example, setting it to 31MB if the constraint is 32MB.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file streamlit-chunk-file-uploader-0.0.1.tar.gz
.
File metadata
- Download URL: streamlit-chunk-file-uploader-0.0.1.tar.gz
- Upload date:
- Size: 1.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ec2f24aed2155fda4a956c63b2ba823e94d2bfdfab21816373ff749d858c95e |
|
MD5 | 821d203f849c8345e8c90d4afa40588e |
|
BLAKE2b-256 | b35c8a03d63938a5a306b2ec38ffa80452e2c83b4397ff5635c1ca2f052dffd6 |
File details
Details for the file streamlit_chunk_file_uploader-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: streamlit_chunk_file_uploader-0.0.1-py3-none-any.whl
- Upload date:
- Size: 2.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91e5f8ad642fc22f0f138b0ee7c20d62b33813a6e8b448e6b5e0ff246b4e0a2b |
|
MD5 | 9bdd8d078681269fe5226ce87d78cc91 |
|
BLAKE2b-256 | 0d9fb3a671987b397ae9102801c44ec3bab8aa5945bf08be4ba560ed9b5a8975 |