mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-27 04:24:45 +00:00
bug: auto-recognize .xlsx files
Signed-off-by: Tim Kellogg <timothy.kellogg@gmail.com>
This commit is contained in:
parent
355d8dc7a6
commit
48d5405db1
@ -283,6 +283,9 @@ class _DocumentConversionInput(BaseModel):
|
||||
if mime is None: # must guess from
|
||||
with obj.open("rb") as f:
|
||||
content = f.read(1024) # Read first 1KB
|
||||
if mime is not None and mime.lower() == "application/zip" and obj.suffixes[-1].lower() == ".xlsx":
|
||||
mime = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||
|
||||
|
||||
elif isinstance(obj, DocumentStream):
|
||||
content = obj.stream.read(8192)
|
||||
|
Loading…
Reference in New Issue
Block a user