Add MIME types for PPT and PPTX files#12562
Conversation
Otherwise, slide files cannot be opened in Chat module
There was a problem hiding this comment.
Pull request overview
This PR adds MIME type mappings for PowerPoint file formats (PPT and PPTX) to enable proper handling of these files in the Chat module. The backend CONTENT_TYPE_MAP dictionary was missing these mappings, causing incorrect content type identification.
Changes:
- Added MIME type entries for PPT and PPTX file formats in the CONTENT_TYPE_MAP dictionary
api/utils/web_utils.py
Outdated
| "ppt": "application/vnd.ms-powerpoint", | ||
| "pptx":"application/vnd.openxmLformats-officedocument.presentationml.presentation", |
There was a problem hiding this comment.
The colon character used here is incorrect. Replace the full-width Chinese colon ":" with a standard ASCII colon ":" to fix the syntax error.
| "ppt": "application/vnd.ms-powerpoint", | |
| "pptx":"application/vnd.openxmLformats-officedocument.presentationml.presentation", | |
| "ppt": "application/vnd.ms-powerpoint", | |
| "pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation", |
api/utils/web_utils.py
Outdated
| "ppt": "application/vnd.ms-powerpoint", | ||
| "pptx":"application/vnd.openxmLformats-officedocument.presentationml.presentation", |
There was a problem hiding this comment.
The comma character used here is incorrect. Replace the full-width Chinese comma "," with a standard ASCII comma "," to fix the syntax error.
| "ppt": "application/vnd.ms-powerpoint", | |
| "pptx":"application/vnd.openxmLformats-officedocument.presentationml.presentation", | |
| "ppt": "application/vnd.ms-powerpoint", | |
| "pptx": "application/vnd.openxmLformats-officedocument.presentationml.presentation", |
api/utils/web_utils.py
Outdated
| "ppt": "application/vnd.ms-powerpoint", | ||
| "pptx":"application/vnd.openxmLformats-officedocument.presentationml.presentation", |
There was a problem hiding this comment.
The MIME type contains a typo. The correct value should be "application/vnd.openxmlformats-officedocument.presentationml.presentation" with "openxmlformats" (lowercase 'm' and 'l') instead of "openxmLformats" (capital 'L').
| "ppt": "application/vnd.ms-powerpoint", | |
| "pptx":"application/vnd.openxmLformats-officedocument.presentationml.presentation", | |
| "ppt": "application/vnd.ms-powerpoint", | |
| "pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation", |
api/utils/web_utils.py
Outdated
| "ppt": "application/vnd.ms-powerpoint", | ||
| "pptx":"application/vnd.openxmLformats-officedocument.presentationml.presentation", |
There was a problem hiding this comment.
The colon character used here is incorrect. Replace the full-width Chinese colon ":" with a standard ASCII colon ":" to fix the syntax error.
| "ppt": "application/vnd.ms-powerpoint", | |
| "pptx":"application/vnd.openxmLformats-officedocument.presentationml.presentation", | |
| "ppt": "application/vnd.ms-powerpoint", | |
| "pptx": "application/vnd.openxmLformats-officedocument.presentationml.presentation", |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Otherwise, slide files cannot be opened in Chat module
What problem does this PR solve?
Backend Reason (API): In the api/utils/web_utils.py file of the backend, the CONTENT_TYPE_MAP dictionary is missing ppt and pptx.
MIME type mapping. This means that when the frontend requests a PPTX file, the backend cannot correctly inform the browser that it is a PPTX file, resulting in the file being displayed incorrectly.
Type identification error.
Type of change