mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
refac
This commit is contained in:
parent
9398c843d3
commit
10855cf5ed
1 changed files with 3 additions and 1 deletions
|
|
@ -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…
Reference in a new issue