Spaces:
Runtime error
Runtime error
added support to save file locally on streamlite demo
Browse files
app.py
CHANGED
|
@@ -14,6 +14,7 @@ import joblib
|
|
| 14 |
from bokeh.models.widgets import Div
|
| 15 |
|
| 16 |
import email
|
|
|
|
| 17 |
#from ipyfilechooser import FileChooser
|
| 18 |
|
| 19 |
#from IPython.display import display
|
|
@@ -262,6 +263,9 @@ target_variables = [
|
|
| 262 |
uploaded_file = st.file_uploader(
|
| 263 |
"Please upload your email (In HTML Format)", type=["html"])
|
| 264 |
|
|
|
|
|
|
|
|
|
|
| 265 |
if uploaded_file is None:
|
| 266 |
# upload_img = PIL.Image.open(uploaded_file)
|
| 267 |
upload_img = None
|
|
|
|
| 14 |
from bokeh.models.widgets import Div
|
| 15 |
|
| 16 |
import email
|
| 17 |
+
import os
|
| 18 |
#from ipyfilechooser import FileChooser
|
| 19 |
|
| 20 |
#from IPython.display import display
|
|
|
|
| 263 |
uploaded_file = st.file_uploader(
|
| 264 |
"Please upload your email (In HTML Format)", type=["html"])
|
| 265 |
|
| 266 |
+
with open(os.path.join("./",uploaded_file.name),"wb") as f:
|
| 267 |
+
f.write(uploaded_file.getbuffer())
|
| 268 |
+
|
| 269 |
if uploaded_file is None:
|
| 270 |
# upload_img = PIL.Image.open(uploaded_file)
|
| 271 |
upload_img = None
|