fix: mime error in document streams (#1523)
Update document.py edit got file mime error Signed-off-by: DavidLee <yongsheng_li@foxmail.com>
This commit is contained in:
parent
7c705739f9
commit
f1658edbad
@ -303,6 +303,14 @@ class _DocumentConversionInput(BaseModel):
|
||||
else ""
|
||||
)
|
||||
mime = _DocumentConversionInput._mime_from_extension(ext)
|
||||
if mime is not None and mime.lower() == "application/zip":
|
||||
objname = obj.name.lower()
|
||||
if objname.endswith(".xlsx"):
|
||||
mime = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||
elif objname.endswith(".docx"):
|
||||
mime = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
||||
elif objname.endswith(".pptx"):
|
||||
mime = "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
||||
|
||||
mime = mime or _DocumentConversionInput._detect_html_xhtml(content)
|
||||
mime = mime or _DocumentConversionInput._detect_csv(content)
|
||||
|
Loading…
Reference in New Issue
Block a user