首页 > 其他分享 >Content-Type常用对照

Content-Type常用对照

时间:2023-10-26 12:55:38浏览次数:30  
标签:vnd String image 对照 Content application video audio Type

转自:https://blog.csdn.net/m0_73746790/article/details/128618371

Content-Type常用对照

  1 import java.util.Objects;
  2 /**
  3  * Content-Type常用对照
  4  */
  5 public enum MimeTypeEnum {
  6     AAC("acc","AAC音频","audio/aac"),
  7     ABW("abw","AbiWord文件","application/x-abiword"),
  8     ARC("arc","存档文件","application/x-freearc"),
  9     AVI("avi","音频视频交错格式","video/x-msvideo"),
 10     AZW("azw","亚马逊Kindle电子书格式","application/vnd.amazon.ebook"),
 11     BIN("bin","任何类型的二进制数据","application/octet-stream"),
 12     BMP("bmp","Windows OS / 2位图图形","image/bmp"),
 13     BZ("bz","BZip存档","application/x-bzip"),
 14     BZ2("bz2","BZip2存档","application/x-bzip2"),
 15     CSH("csh","C-Shell脚本","application/x-csh"),
 16     CSS("css","级联样式表(CSS)","text/css"),
 17     CSV("csv","逗号分隔值(CSV)","text/csv"),
 18     DOC("doc","微软Word文件","application/msword"),
 19     DOCX("docx","Microsoft Word(OpenXML)","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),
 20     EOT("eot","MS Embedded OpenType字体","application/vnd.ms-fontobject"),
 21     EPUB("epub","电子出版物(EPUB)","application/epub+zip"),
 22     GZ("gz","GZip压缩档案","application/gzip"),
 23     GIF("gif","图形交换格式(GIF)","image/gif"),
 24     HTM("htm","超文本标记语言(HTML)","text/html"),
 25     HTML("html","超文本标记语言(HTML)","text/html"),
 26     ICO("ico","图标格式","image/vnd.microsoft.icon"),
 27     ICS("ics","iCalendar格式","text/calendar"),
 28     JAR("jar","Java存档","application/java-archive"),
 29     JPEG("jpeg","JPEG图像","image/jpeg"),
 30     JPG("jpg","JPEG图像","image/jpeg"),
 31     JS("js","JavaScript","text/javascript"),
 32     JSON("json","JSON格式","application/json"),
 33     JSONLD("jsonld","JSON-LD格式","application/ld+json"),
 34     MID("mid","乐器数字接口(MIDI)","audio/midi"),
 35     MIDI("midi","乐器数字接口(MIDI)","audio/midi"),
 36     MJS("mjs","JavaScript模块","text/javascript"),
 37     MP3("mp3","MP3音频","audio/mpeg"),
 38     MPEG("mpeg","MPEG视频","video/mpeg"),
 39     MPKG("mpkg","苹果安装程序包","application/vnd.apple.installer+xml"),
 40     ODP("odp","OpenDocument演示文稿文档","application/vnd.oasis.opendocument.presentation"),
 41     ODS("ods","OpenDocument电子表格文档","application/vnd.oasis.opendocument.spreadsheet"),
 42     ODT("odt","OpenDocument文字文件","application/vnd.oasis.opendocument.text"),
 43     OGA("oga","OGG音讯","audio/ogg"),
 44     OGV("ogv","OGG视频","video/ogg"),
 45     OGX("ogx","OGG","application/ogg"),
 46     OPUS("opus","OPUS音频","audio/opus"),
 47     OTF("otf","otf字体","font/otf"),
 48     PNG("png","便携式网络图形","image/png"),
 49     PDF("pdf","Adobe 可移植文档格式(PDF)","application/pdf"),
 50     PHP("php","php","application/x-httpd-php"),
 51     PPT("ppt","Microsoft PowerPoint","application/vnd.ms-powerpoint"),
 52     PPTX("pptx","Microsoft PowerPoint(OpenXML)","application/vnd.openxmlformats-officedocument.presentationml.presentation"),
 53     RAR("rar","RAR档案","application/vnd.rar"),
 54     RTF("rtf","富文本格式","application/rtf"),
 55     SH("sh","Bourne Shell脚本","application/x-sh"),
 56     SVG("svg","可缩放矢量图形(SVG)","image/svg+xml"),
 57     SWF("swf","小型Web格式(SWF)或Adobe Flash文档","application/x-shockwave-flash"),
 58     TAR("tar","磁带存档(TAR)","application/x-tar"),
 59     TIF("tif","标记图像文件格式(TIFF)","image/tiff"),
 60     TIFF("tiff","标记图像文件格式(TIFF)","image/tiff"),
 61     TS("ts","MPEG传输流","video/mp2t"),
 62     TTF("ttf","ttf字体","font/ttf"),
 63     TXT("txt","文本(通常为ASCII或ISO 8859- n","text/plain"),
 64     VSD("vsd","微软Visio","application/vnd.visio"),
 65     WAV("wav","波形音频格式","audio/wav"),
 66     WEBA("weba","WEBM音频","audio/webm"),
 67     WEBM("webm","WEBM视频","video/webm"),
 68     WEBP("webp","WEBP图像","image/webp"),
 69     WOFF("woff","Web开放字体格式(WOFF)","font/woff"),
 70     WOFF2("woff2","Web开放字体格式(WOFF)","font/woff2"),
 71     XHTML("xhtml","XHTML","application/xhtml+xml"),
 72     XLS("xls","微软Excel","application/vnd.ms-excel"),
 73     XLSX("xlsx","微软Excel(OpenXML)","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),
 74     XML("xml","XML","application/xml"),
 75     XUL("xul","XUL","application/vnd.mozilla.xul+xml"),
 76     ZIP("zip","ZIP","application/zip"),
 77     MIME_3GP("3gp", "3GPP audio/video container", "video/3gpp"),
 78     MIME_3GP_WITHOUT_VIDEO("3gp", "3GPP audio/video container doesn't contain video", "audio/3gpp2"),
 79     MIME_3G2("3g2", "3GPP2 audio/video container", "video/3gpp2"),
 80     MIME_3G2_WITHOUT_VIDEO("3g2", "3GPP2 audio/video container  doesn't contain video", "audio/3gpp2"),
 81     MIME_7Z("7z","7-zip存档","application/x-7z-compressed")
 82     ;
 83 
 84     private String extension;
 85 
 86     private String explain;
 87 
 88     private String mimeType;
 89 
 90     MimeTypeEnum(String extension, String explain, String mimeType) {
 91         this.extension = extension;
 92         this.explain = explain;
 93         this.mimeType = mimeType;
 94     }
 95 
 96     public static MimeTypeEnum findByExtension(String extension) {
 97         if(Objects.isNull(extension) || extension.length() == 0){
 98             return null;
 99         }
100         for (MimeTypeEnum typesEnum : MimeTypeEnum.values()) {
101             if (extension.equals(typesEnum.getExtension())) {
102                 return typesEnum;
103             }
104         }
105         return null;
106     }
107 
108     /**
109      * Content-Type常用对照
110      * @param fileType
111      */
112     public static String getContentType(String fileType) {
113         MimeTypeEnum mimeTypeEnum = MimeTypeEnum.findByExtension(fileType);
114         if(mimeTypeEnum != null){
115             return mimeTypeEnum.getMimeType();
116         }
117         return "application/octet-stream";
118     }
119 
120     public String getMimeType() {
121         return mimeType;
122     }
123 
124     public String getExtension() {
125         return extension;
126     }
127 
128     public String getExplain() {
129         return explain;
130     }
131 }

 

标签:vnd,String,image,对照,Content,application,video,audio,Type
From: https://www.cnblogs.com/gzy2016Blog/p/17789160.html

相关文章

  • Android压测测试事件行为参数对照表
    一、压测命令参数说明执行参数参数说明颗粒度指标基础参数--throttle<ms>用于指定用户操作间的时延。-s随机数种子,用于指定伪随机数生成器的seed值,如果seed值相同,则产生的时间序列也相同。多用于重测、复现问题。-v指定输出日志的级别,共有3个级别。1)-v:仅提供启动提示、测试完......
  • 以下是一个使用 TypeORM 事务的示例:
    以下是一个使用TypeORM事务的示例:typescriptimport{getConnection}from"typeorm";import{Category,Repository}from"./entity/index";asyncfunctionrun(){constcategoryRepository=getConnection().getRepository(Category);constrepositor......
  • [ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/
     永久解决方法:在/etc/sysctl.conf中添加:net.bridge.bridge-nf-call-ip6tables=1net.bridge.bridge-nf-call-iptables=1执行sysctl-p时刷新sysctl-p如果出现缺少文件的现象sysctl:cannotstat/proc/sys/net/bridge/bridge-nf-call-iptables:没有那个文......
  • 使用 content scripts 和 Vue Router 等技术在当前页面中注入和显示 Vue 单文件组件
    要在当前页面中注入和显示Vue单文件组件,您需要按照以下步骤操作:创建一个Vue项目:首先,确保您有一个Vue项目,包括您的Vue单文件组件以及相应的构建配置。将构建后的文件添加到插件目录:将Vue项目构建后生成的HTML、CSS和JavaScript文件添加到您的Chrome插件的目录中。编......
  • 鸿蒙极速入门(三)-TypeScript语言简介
    ArkTS是HarmonyOS优选的主力应用开发语言。ArkTS围绕应用开发在TypeScript(简称TS)生态基础上做了进一步扩展,继承了TS的所有特性,是TS的超集。因此,在学习ArkTS语言之前,需要先了解一下TS语言的基础知识。一、基础类型1.数字类型-number双精度64位浮点值。它可以用来表示整数和分......
  • TypeScript入门到精通——TypeScript类型系统基础——函数类型
    函数类型一、常规参数类型 在函数形式参数列表中,为参数添加类型注解就能够定义参数的类型。例如,在下列中将add函数声明中的参数x和参数y的类型都定义为number类型。functionadd(x:number,y:number){returnx+y;} 针对函数表达式和匿名函数,我们也可......
  • SpringBoot内容协商(Content Negotiation)二 —— 自定义消息转换器(MessageConverter)
    SpringBoot内置的消息转换器SpringBoot没有处理返回yaml格式的数据,这里需要手动添加处理这种返回格式的支持。导入依赖<dependency><groupId>com.fasterxml.jackson.dataformat</groupId><artifactId>jackson-dataformat-yaml</artifactId></dependency>添加配......
  • 1024程序员节,我们来点轻松的,拼手速截图看看你是哪种type的程序员!
    “爱码士”们来拼手速!云宏君今日也是“需求加载中“,与身边的it小伙伴一起来找标签吧......
  • TypeScript入门到精通——TypeScript类型系统基础——对象类型
    对象类型 在JavaScript中存在这样一种说法,那就是"一切皆为对象"。有这种说法是因为JavaScript中绝大多数值都可以使用对象来表示。例如:函数、数组和对象字面量本质上都是对象。对于原始数据类型、如String类型,JavaScript也提供了相应的构造函数来创建能够表示原始值的......
  • std::optional<type>
    它可以将可能存在或者不存在的内容以合适的方式返回,当返回的是空文件时,可以使用_.value_or("初始值")std::optional<std::string>data=OpenFileAsstring("data.txt");stringvalue=data.value_or("NotOpened!"); ......