Commit
·
b3db418
1
Parent(s):
5a58264
Update app.py
Browse files
app.py
CHANGED
@@ -253,10 +253,22 @@ with st.form("my_form"):
|
|
253 |
'''
|
254 |
st.markdown(multi)
|
255 |
#uploaded_file = st.file_uploader("Choose a file")
|
256 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
print('uploaded_files ', uploaded_files)
|
258 |
if uploaded_files is not None:
|
259 |
-
list_docs, list_save_path = util_upload_file_and_return_list_docs(uploaded_files)
|
260 |
print('list_docs ' ,list_docs)
|
261 |
print('list_save_path ' , list_save_path)
|
262 |
|
|
|
253 |
'''
|
254 |
st.markdown(multi)
|
255 |
#uploaded_file = st.file_uploader("Choose a file")
|
256 |
+
|
257 |
+
list_docs = []
|
258 |
+
list_save_path = []
|
259 |
+
|
260 |
+
uploaded_files = st.file_uploader("Choose file(s)", accept_multiple_files=True)
|
261 |
+
for uploaded_file in uploaded_files:
|
262 |
+
save_path = Path(os.getcwd(), uploaded_file.name)
|
263 |
+
with open(save_path, mode='wb') as w:
|
264 |
+
w.write(uploaded_file.getvalue())
|
265 |
+
docs = fitz.open(save_path)
|
266 |
+
list_docs.append(docs)
|
267 |
+
list_save_path.append(save_path)
|
268 |
+
|
269 |
print('uploaded_files ', uploaded_files)
|
270 |
if uploaded_files is not None:
|
271 |
+
#list_docs, list_save_path = util_upload_file_and_return_list_docs(uploaded_files)
|
272 |
print('list_docs ' ,list_docs)
|
273 |
print('list_save_path ' , list_save_path)
|
274 |
|