mirror of
https://github.com/open-webui/open-webui
synced 2024-11-21 23:57:51 +00:00
enh: empty file handling behaviour
This commit is contained in:
parent
25a37baeec
commit
e36acd6217
@ -76,7 +76,7 @@ def upload_file(file: UploadFile = File(...), user=Depends(get_verified_user)):
|
||||
file_item = FileModelResponse(
|
||||
**{
|
||||
**file_item.model_dump(),
|
||||
"error": e,
|
||||
"error": str(e.detail) if hasattr(e, "detail") else str(e),
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -133,6 +133,10 @@
|
||||
const uploadedFile = await uploadFile(localStorage.token, file);
|
||||
|
||||
if (uploadedFile) {
|
||||
if (uploadedFile.error) {
|
||||
toast.warning(uploadedFile.error);
|
||||
}
|
||||
|
||||
fileItem.status = 'uploaded';
|
||||
fileItem.file = uploadedFile;
|
||||
fileItem.id = uploadedFile.id;
|
||||
|
Loading…
Reference in New Issue
Block a user