Component evidence

getMimeFromFilename (media/mime.ts)

Jumping-Agent-platform · apps/weixin-main/src/media/mime.ts · typescript · Apache-2.0
files

Utility for mapping file extensions to MIME types and content types.

Source preview first 800 characters · full source over MCP
// Source: https://github.com/answeryt/Jumping-Agent-platform | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import path from "node:path";

const EXTENSION_TO_MIME: Record<string, string> = {
  ".pdf": "application/pdf",
  ".doc": "application/msword",
  ".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  ".xls": "application/vnd.ms-excel",
  ".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
  ".ppt": "application/vnd.ms-powerpoint",
  ".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
  ".txt": "text/plain",
  ".csv": "text/csv",
  ".zip": "application/zip",
  ".tar": "application/x-

... (truncated -- full source via MCP)