zhangqian hai 1 ano
pai
achega
a455ada8f4
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      app/api/excel.py

+ 1 - 2
app/api/excel.py

@@ -56,8 +56,7 @@ async def upload_file(files: list[UploadFile] = File(...)):
         if file.filename == '':
             return JSONResponse(content={"error": "没有选择文件"}, status_code=400)
         if file and allowed_file(file.filename):
-            filename = secure_filename(file.filename)
-            save_path = os.path.join(SOURCE_FILES_PATH, filename)
+            save_path = os.path.join(SOURCE_FILES_PATH, file.filename)
             with open(save_path, 'wb') as buffer:
                 shutil.copyfileobj(file.file, buffer)
             save_path_list.append(save_path)