prashant
commited on
Commit
·
c73b10a
1
Parent(s):
05064f1
upload path fix
Browse files
utils/uploadAndExample.py
CHANGED
@@ -14,14 +14,14 @@ def add_upload(choice):
|
|
14 |
uploaded_file = st.sidebar.file_uploader('Upload the File',
|
15 |
type=['pdf', 'docx', 'txt'])
|
16 |
if uploaded_file is not None:
|
17 |
-
with tempfile.NamedTemporaryFile(mode="wb") as temp:
|
18 |
bytes_data = uploaded_file.getvalue()
|
19 |
temp.write(bytes_data)
|
20 |
st.session_state['filename'] = uploaded_file.name
|
21 |
-
file_name = uploaded_file.name
|
22 |
-
file_path = temp.name
|
23 |
-
st.session_state['filename'] = file_name
|
24 |
-
st.session_state['filepath'] =
|
25 |
|
26 |
|
27 |
|
|
|
14 |
uploaded_file = st.sidebar.file_uploader('Upload the File',
|
15 |
type=['pdf', 'docx', 'txt'])
|
16 |
if uploaded_file is not None:
|
17 |
+
with tempfile.NamedTemporaryFile(mode="wb", delete = False) as temp:
|
18 |
bytes_data = uploaded_file.getvalue()
|
19 |
temp.write(bytes_data)
|
20 |
st.session_state['filename'] = uploaded_file.name
|
21 |
+
# file_name = uploaded_file.name
|
22 |
+
# file_path = temp.name
|
23 |
+
# st.session_state['filename'] = file_name
|
24 |
+
st.session_state['filepath'] = temp.name
|
25 |
|
26 |
|
27 |
|