fixing file uplaod
Browse files- Dockerfile +1 -1
- main.py +14 -0
Dockerfile
CHANGED
|
@@ -18,4 +18,4 @@ EXPOSE 8501
|
|
| 18 |
|
| 19 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 20 |
|
| 21 |
-
ENTRYPOINT ["streamlit", "run", "
|
|
|
|
| 18 |
|
| 19 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 20 |
|
| 21 |
+
ENTRYPOINT ["streamlit", "run", "main.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
main.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
uploaded_file = st.file_uploader("Upload your file", type=["txt","pdf"])
|
| 7 |
+
if uploaded_file is not None:
|
| 8 |
+
st.write("Filename:", uploaded_file.name)
|
| 9 |
+
data = uploaded_file.read()
|
| 10 |
+
|
| 11 |
+
if uploaded_file.type == "text/plain":
|
| 12 |
+
st.text_area("Content", data.decode("utf-8"), height=300)
|
| 13 |
+
else:
|
| 14 |
+
st.info(f"Uploaded {len(data)} bytes (PDF or other format)")
|