Spaces:
Runtime error
Runtime error
Update app.py
#2
by
allenchienxxx
- opened
analze.py
CHANGED
|
@@ -31,9 +31,8 @@ def check_file_type(file):
|
|
| 31 |
return "Please select .eml or .txt file."
|
| 32 |
|
| 33 |
def save_file(file):
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
f.write(file.read().decode('utf-8'))
|
| 37 |
|
| 38 |
def text_feature(filepath):
|
| 39 |
text = get_text(filepath)
|
|
|
|
| 31 |
return "Please select .eml or .txt file."
|
| 32 |
|
| 33 |
def save_file(file):
|
| 34 |
+
with open(os.path.join('email files/', uploaded_file.name), 'wb') as f:
|
| 35 |
+
f.write(uploaded_file.getbuffer())
|
|
|
|
| 36 |
|
| 37 |
def text_feature(filepath):
|
| 38 |
text = get_text(filepath)
|