diff --git a/frontend/src/utils/attachment.ts b/frontend/src/utils/attachment.ts index 93254491..b68cfd59 100644 --- a/frontend/src/utils/attachment.ts +++ b/frontend/src/utils/attachment.ts @@ -6,24 +6,46 @@ * 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file). */ - import { IAttachment } from "@/types/attachment.types"; import { FileType, TAttachmentForeignKey } from "@/types/message.types"; import { buildURL } from "./URL"; export const MIME_TYPES = { - images: ["image/jpeg", "image/png", "image/gif", "image/webp"], - videos: ["video/mp4", "video/webm", "video/ogg"], - audios: ["audio/mpeg", "audio/ogg", "audio/wav"], + images: ["image/jpeg", "image/png", "image/webp", "image/bmp"], + videos: [ + "video/mp4", + "video/webm", + "video/ogg", + "video/quicktime", // common in apple devices + "video/x-msvideo", // AVI + "video/x-matroska", // MKV + ], + audios: [ + "audio/mpeg", // MP3 + "audio/mp3", // Explicit MP3 type + "audio/ogg", + "audio/wav", + "audio/aac", // common in apple devices + "audio/x-wav", + ], documents: [ "application/pdf", - "application/msword", + "application/msword", // older ms Word format + "application/vnd.openxmlformats-officedocument.wordprocessingml.document", // newer ms word format "application/vnd.openxmlformats-officedocument.wordprocessingml.document", - "application/vnd.ms-excel", - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "application/vnd.ms-excel", // older excel format + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", // newer excel format "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation", + "text/plain", + "application/rtf", + "application/epub", // do we want to support epub? + "application/x-7z-compressed", // do we want to support 7z? + "application/zip", // do we want to support zip? + "application/x-rar-compressed", // do we want to support winrar? + "application/json", + "text/csv", ], }; @@ -68,4 +90,4 @@ export function extractFilenameFromUrl(url: string) { // If the URL is invalid, return the input as-is return url; } -} \ No newline at end of file +}