This commit is contained in:
parent
2a11292c9b
commit
72f99495f8
|
|
@ -25,7 +25,8 @@ def upload_user_file(user_id: str = Form(...), file: UploadFile = File(...)):
|
|||
raise HTTPException(status_code=400, detail="不支持的文件类型")
|
||||
|
||||
# 检查文件大小
|
||||
if file.spool_max_size > MAX_FILE_SIZE:
|
||||
file_size = len(file.file.read()) # 获取文件大小(字节)
|
||||
if file_size > MAX_FILE_SIZE:
|
||||
raise HTTPException(status_code=400, detail="文件太大,请上传不超过50MB的文件")
|
||||
|
||||
# 创建用户文档目录
|
||||
|
|
|
|||
Loading…
Reference in New Issue