Map<String,String>contentTypeMap=newHashMap<>();contentTypeMap.put("xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");contentTypeMap.put("xls","application/vnd.ms-excel"); 1. 2. 3. 在上面的代码中,我们使用java.util.Map接口来定义扩展名与contentType的映射关系。你可以根...
'.xlsx':'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', '.xlt':'application/vnd.ms-excel', '.xlw':'application/vnd.ms-excel', '.xm':'audio/x-xm', '.xmf':'audio/x-xmf', '.xmi':'text/x-xmi', '.xml':'application/xml', '.xpm':'image/x-xpixmap', '.xps...
Excel文档:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet(对于.xlsx文件) 其他常见文件: HTML文档:text/html 纯文本文件:text/plain RTF文本:application/rtf 对于文件上传,特别是包含文件的表单提交,最常用的content-type是multipart/form-data。 2. 使用multipart/form-data上传文件 当需要...
'.xls': 'application/vnd.ms-excel', // Excel工作簿 '.xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', // Excel 2007及更高版本的工作簿 '.xlt': 'application/vnd.ms-excel', // Excel模板 '.xlw': 'application/vnd.ms-excel', // Excel工作区 '.xm': 'audio/x...
如果是excel2007以后的那么contenttype应该设置为 Excelcontenttype类型 Excelcontenttype类型 一般来说导出excel时 如果是excel97~2003,那么content-type应该设置为:application/vnd.ms-excel, 如果是excel2007以后的,那么content-type应该设置为:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet...
image/*application/pdfapplication/mswordapplication/vnd.ms-excel其他开始获取contentType判断contentType返回.jpg或.png返回.pdf返回.doc或.docx返回.xls或.xlsx返回无后缀或默认后缀结束 实现步骤 获取文件的contentType。 根据contentType判断文件类型。 返回对应的文件后缀名。
excel3637.xlsx3839application/vnd.openxmlformats-officedocument.spreadsheetml.sheet4041.xltx4243application/vnd.openxmlformats-officedocument.spreadsheetml.template4445.xlsm4647application/vnd.ms-excel.sheet.macroEnabled.124849.xltm5051application/vnd.ms-excel.template.macroEnabled.125253.xlam5455application/vnd...
public const string Xlsx = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; public const string Xml = "application/xml"; public const string Xpm = "image/x-xpixmap"; public const string Xsl = "application/xml"; @@ -183,4 +183,4 @@ public static class ContentType publi...
681 '.xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 682 '.xlt': 'application/vnd.ms-excel', 683 '.xlw': 'application/vnd.ms-excel', 684 '.xm': 'audio/x-xm', 685 '.xmf': 'audio/x-xmf', 686 '.xmi': 'text/x-xmi', 687 '.xml': 'application/xml...
XLSX("xlsx","微软Excel(OpenXML)","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"), XML("xml","XML","application/xml"), XUL("xul","XUL","application/vnd.mozilla.xul+xml"), ZIP("zip","ZIP","application/zip"), ...