Feature/Excel and PPT File Uploads (#4896)

Enhance file upload capabilities by adding support for additional file types (html, css, js, xml, md, excel, powerpoint) and updating related MIME type mappings. Improve user interface for file type selection in FileUpload component.
This commit is contained in:
Henry Heng
2025-07-18 19:08:02 +01:00
committed by GitHub
parent 2b7a074c8b
commit fbe9f34a60
4 changed files with 89 additions and 32 deletions
+27
View File
@@ -1070,7 +1070,17 @@ export const mapMimeTypeToInputField = (mimeType: string) => {
case 'text/jsonl':
return 'jsonlinesFile'
case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
case 'application/msword': {
return 'docxFile'
}
case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
case 'application/vnd.ms-excel': {
return 'excelFile'
}
case 'application/vnd.openxmlformats-officedocument.presentationml.presentation':
case 'application/vnd.ms-powerpoint': {
return 'powerpointFile'
}
case 'application/vnd.yaml':
case 'application/x-yaml':
case 'text/vnd.yaml':
@@ -1091,6 +1101,19 @@ export const mapMimeTypeToExt = (mimeType: string) => {
switch (mimeType) {
case 'text/plain':
return 'txt'
case 'text/html':
return 'html'
case 'text/css':
return 'css'
case 'text/javascript':
case 'application/javascript':
return 'js'
case 'text/xml':
case 'application/xml':
return 'xml'
case 'text/markdown':
case 'text/x-markdown':
return 'md'
case 'application/pdf':
return 'pdf'
case 'application/json':
@@ -1109,6 +1132,10 @@ export const mapMimeTypeToExt = (mimeType: string) => {
return 'xls'
case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
return 'xlsx'
case 'application/vnd.ms-powerpoint':
return 'ppt'
case 'application/vnd.openxmlformats-officedocument.presentationml.presentation':
return 'pptx'
default:
return ''
}