mitulagr2 commited on
Commit
24992a3
1 Parent(s): 2cfa0e6
Files changed (1) hide show
  1. app/main.py +2 -2
app/main.py CHANGED
@@ -40,9 +40,9 @@ def upload(files: list[UploadFile]):
40
 
41
  try:
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()
 
40
 
41
  try:
42
  for file in files:
 
43
  try:
44
+ file.file.seek(0)
45
+ with Path("files/").open("wb") as destination:
46
  shutil.copyfileobj(file.file, destination)
47
  finally:
48
  file.file.close()