Update src/streamlit_app.py
Browse files- src/streamlit_app.py +2 -1
src/streamlit_app.py
CHANGED
|
@@ -76,7 +76,8 @@ elif doc_choice == "Sample PDF":
|
|
| 76 |
elif doc_choice == "Upload Custom PDF":
|
| 77 |
uploaded_file = st.file_uploader("π Upload your PDF", type="pdf")
|
| 78 |
if uploaded_file:
|
| 79 |
-
|
|
|
|
| 80 |
with open(temp_path, "wb") as f:
|
| 81 |
f.write(uploaded_file.getbuffer())
|
| 82 |
st.success("β
Document uploaded and processed!")
|
|
|
|
| 76 |
elif doc_choice == "Upload Custom PDF":
|
| 77 |
uploaded_file = st.file_uploader("π Upload your PDF", type="pdf")
|
| 78 |
if uploaded_file:
|
| 79 |
+
# Always write to /tmp (the only guaranteed writable folder)
|
| 80 |
+
temp_path = os.path.join("/tmp", uploaded_file.name)
|
| 81 |
with open(temp_path, "wb") as f:
|
| 82 |
f.write(uploaded_file.getbuffer())
|
| 83 |
st.success("β
Document uploaded and processed!")
|