Skip to content

Add MIME types for PPT and PPTX files#12562

Merged
KevinHuSh merged 2 commits intoinfiniflow:mainfrom
LiruiYu33:patch-10
Jan 13, 2026
Merged

Add MIME types for PPT and PPTX files#12562
KevinHuSh merged 2 commits intoinfiniflow:mainfrom
LiruiYu33:patch-10

Conversation

@LiruiYu33
Copy link
Contributor

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

  • Bug Fix (non-breaking change which fixes an issue)

Otherwise, slide files cannot be opened in Chat module
Copilot AI review requested due to automatic review settings January 12, 2026 11:17
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. 🐞 bug Something isn't working, pull request that fix bug. labels Jan 12, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +90 to +91
"ppt": "application/vnd.ms-powerpoint",
"pptx":"application/vnd.openxmLformats-officedocument.presentationml.presentation",
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The colon character used here is incorrect. Replace the full-width Chinese colon ":" with a standard ASCII colon ":" to fix the syntax error.

Suggested change
"ppt" "application/vnd.ms-powerpoint"
"pptx""application/vnd.openxmLformats-officedocument.presentationml.presentation"
"ppt": "application/vnd.ms-powerpoint",
"pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",

Copilot uses AI. Check for mistakes.
Comment on lines +90 to +91
"ppt": "application/vnd.ms-powerpoint",
"pptx":"application/vnd.openxmLformats-officedocument.presentationml.presentation",
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comma character used here is incorrect. Replace the full-width Chinese comma "," with a standard ASCII comma "," to fix the syntax error.

Suggested change
"ppt" "application/vnd.ms-powerpoint"
"pptx""application/vnd.openxmLformats-officedocument.presentationml.presentation"
"ppt": "application/vnd.ms-powerpoint",
"pptx": "application/vnd.openxmLformats-officedocument.presentationml.presentation",

Copilot uses AI. Check for mistakes.
Comment on lines +90 to +91
"ppt": "application/vnd.ms-powerpoint",
"pptx":"application/vnd.openxmLformats-officedocument.presentationml.presentation",
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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').

Suggested change
"ppt" "application/vnd.ms-powerpoint"
"pptx""application/vnd.openxmLformats-officedocument.presentationml.presentation"
"ppt": "application/vnd.ms-powerpoint",
"pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",

Copilot uses AI. Check for mistakes.
Comment on lines +90 to +91
"ppt": "application/vnd.ms-powerpoint",
"pptx":"application/vnd.openxmLformats-officedocument.presentationml.presentation",
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The colon character used here is incorrect. Replace the full-width Chinese colon ":" with a standard ASCII colon ":" to fix the syntax error.

Suggested change
"ppt" "application/vnd.ms-powerpoint"
"pptx""application/vnd.openxmLformats-officedocument.presentationml.presentation"
"ppt": "application/vnd.ms-powerpoint",
"pptx": "application/vnd.openxmLformats-officedocument.presentationml.presentation",

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@KevinHuSh KevinHuSh added the ci Continue Integration label Jan 13, 2026
@KevinHuSh KevinHuSh marked this pull request as draft January 13, 2026 01:49
@KevinHuSh KevinHuSh marked this pull request as ready for review January 13, 2026 01:49
@KevinHuSh KevinHuSh merged commit 41c84fd into infiniflow:main Jan 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants