mirror of
https://git.mirrors.martin98.com/https://github.com/open-webui/open-webui
synced 2025-08-18 07:25:53 +08:00
refac
This commit is contained in:
parent
9398c843d3
commit
10855cf5ed
@ -83,10 +83,12 @@ def upload_file(
|
|||||||
request: Request,
|
request: Request,
|
||||||
file: UploadFile = File(...),
|
file: UploadFile = File(...),
|
||||||
user=Depends(get_verified_user),
|
user=Depends(get_verified_user),
|
||||||
file_metadata: dict = {},
|
file_metadata: dict = None,
|
||||||
process: bool = Query(True),
|
process: bool = Query(True),
|
||||||
):
|
):
|
||||||
log.info(f"file.content_type: {file.content_type}")
|
log.info(f"file.content_type: {file.content_type}")
|
||||||
|
|
||||||
|
file_metadata = file_metadata if file_metadata else {}
|
||||||
try:
|
try:
|
||||||
unsanitized_filename = file.filename
|
unsanitized_filename = file.filename
|
||||||
filename = os.path.basename(unsanitized_filename)
|
filename = os.path.basename(unsanitized_filename)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user