Spaces:
Running
Running
fix upload
Browse files- app/main.py +2 -4
app/main.py
CHANGED
@@ -42,10 +42,8 @@ def upload(files: list[UploadFile]):
|
|
42 |
for file in files:
|
43 |
path = f"files/{file.filename}"
|
44 |
try:
|
45 |
-
|
46 |
-
|
47 |
-
shutil.copyfileobj(file.file, tmp)
|
48 |
-
|
49 |
finally:
|
50 |
file.file.close()
|
51 |
finally:
|
|
|
42 |
for file in files:
|
43 |
path = f"files/{file.filename}"
|
44 |
try:
|
45 |
+
with Path(path).open("wb") as destination:
|
46 |
+
shutil.copyfileobj(file.file, destination)
|
|
|
|
|
47 |
finally:
|
48 |
file.file.close()
|
49 |
finally:
|