各类型文件的type

export const typeToSuffix = {
    "application/msword": "doc",
    "application/vnd.openxmlformats-officedocument.wordprocessingml.document": "docx",
    "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlsx",
    "application/vnd.ms-excel": "xls",
    "application/vnd.openxmlformats-officedocument.presentationml.presentation": "pptx",
    "application/x-zip-compressed": "zip",
    "image/svg+xml": "svg",
    "image/png": "png",
    "image/jpeg": "jpg",
    "application/json": "json",
    "application/pdf": "pdf",
    "video/mp4": "mp4",
    "application/x-msdownload": "exe",
    "application/x-x509-ca-cert": "crt",
    "text/html": "html",
    "text/plain": "txt",
   "image/x-icon":"ico",
   "text/css":"css",
"text/javascript":"js"
};
export const officeOpen = ["docx", "doc", "xls", "xlsx", "pptx", "ppt", "pdf", "txt"];
export const imageOpen = ["jpg","png","jpeg","bmp","gif","ico"];
export const videoOpen = ["mp4","mp3"];
export const code = ["css","js","html","json"]

 

export const fileFormatter = {
    ".xls": "application/vnd.ms-excel",
    ".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
    ".csv": "text/csv",
    ".doc": "application/msword",
    ".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
    ".pdf": "application/pdf",
    ".ppt": "application/vnd.ms-powerpoint",
    ".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
    ".png": "image/png",
    ".gif": "image/gif",
    ".jpeg": "image/jpeg",
    ".jpg":"image/jpeg",
    ".mp3":"audio/mpeg",
    "mp4":"video/mp4",
    ".aac": "audio/aac",
    ".html": "text/html",
    ".css": "text/css",
    ".js": "text/javascript",
    ".json": "application/json",
    ".abw": "application/x-abiword",
    ".arc": "application/x-freearc",
    ".avi": "video/x-msvideo",
    ".azw": "application/vnd.amazon.ebook",
    ".bin": "application/octet-stream",
    ".bmp": "image/bmp",
    ".bz": "application/x-bzip",
    ".bz2": "application/x-bzip2",
    ".csh": "application/x-csh",
    ".eot": "application/vnd.ms-fontobject",
    ".epub": "application/epub+zip",
    ".html": "text/html",
    ".ico": "image/vnd.microsoft.icon",
    ".ics": "text/calendar",
    ".jar": "application/java-archive",
    ".rar": "application/x-rar-compressed",
    ".tar":"application/x-tar",
    ".svg": "image/svg+xml",
    ".swf": "application/x-shockwave-flash",
    ".tar": "application/x-tar",
    ".tif": "image/tiff",
    ".ttf": "font/ttf",
    ".txt": "text/plain",
    ".vsd": "application/vnd.visio",
    ".wav": "audio/wav",
    ".weba": "audio/webm",
    ".webm": "video/webm",
    ".webp": "image/webp",
    ".woff": "font/woff",
    ".zip": "application/zip",
    "exe": "application/x-msdownload",
    "crt":"application/x-x509-ca-cert"
};

export const fileTypeList = [".xls", ".xlsx", ".csv", ".doc", ".docx", ".pdf", ".ppt", ".pptx", ".png", ".gif", ".jpeg",
    ".jpg", ".mp3", ".aac", ".html", ".css", ".js", ".json", ".abw", ".arc", ".avi", ".azw", ".bin", ".bmp", ".bz", ".bz2",
    ".csh", ".eot", ".epub", ".html", ".ico", ".ics", ".jar", ".rar", ".svg", ".swf", ".tar", ".tif", ".ttf", ".txt", ".vsd", ".wav",
    ".weba",".webm",".webp",".woff",".zip"]

 

posted @ 2025-09-25 19:09  enShine  阅读(14)  评论(0)    收藏  举报