Shubham170793 commited on
Commit
0cacffd
Β·
verified Β·
1 Parent(s): 0b5b2f6

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. 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
- temp_path = "temp.pdf"
 
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!")