`

struts2上传下载所用文件类型[扩展名]对应一览表

    博客分类:
  • JAVA
阅读更多

<!-- ===================== Default MIME Type Mappings =================== -->

  <!-- When serving static resources, Tomcat will automatically generate    -->

  <!-- a "Content-Type" header based on the resource's filename extension,  -->

  <!-- based on these mappings.  Additional mappings can be added here (to  -->

  <!-- apply to all web applications), or in your own application's web.xml -->

  <!-- deployment descriptor.                                               -->

 

    <mime-mapping>

        <extension>abs</extension>

        <mime-type>audio/x-mpeg</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>ai</extension>

        <mime-type>application/postscript</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>aif</extension>

        <mime-type>audio/x-aiff</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>aifc</extension>

        <mime-type>audio/x-aiff</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>aiff</extension>

        <mime-type>audio/x-aiff</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>aim</extension>

        <mime-type>application/x-aim</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>art</extension>

        <mime-type>image/x-jg</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>asf</extension>

        <mime-type>video/x-ms-asf</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>asx</extension>

        <mime-type>video/x-ms-asf</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>au</extension>

        <mime-type>audio/basic</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>avi</extension>

        <mime-type>video/x-msvideo</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>avx</extension>

        <mime-type>video/x-rad-screenplay</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>bcpio</extension>

        <mime-type>application/x-bcpio</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>bin</extension>

        <mime-type>application/octet-stream</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>bmp</extension>

        <mime-type>image/bmp</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>body</extension>

        <mime-type>text/html</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>cdf</extension>

        <mime-type>application/x-cdf</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>cer</extension>

        <mime-type>application/x-x509-ca-cert</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>class</extension>

        <mime-type>application/java</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>cpio</extension>

        <mime-type>application/x-cpio</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>csh</extension>

        <mime-type>application/x-csh</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>css</extension>

        <mime-type>text/css</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>dib</extension>

        <mime-type>image/bmp</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>doc</extension>

        <mime-type>application/msword</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>dtd</extension>

        <mime-type>application/xml-dtd</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>dv</extension>

        <mime-type>video/x-dv</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>dvi</extension>

        <mime-type>application/x-dvi</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>eps</extension>

        <mime-type>application/postscript</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>etx</extension>

        <mime-type>text/x-setext</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>exe</extension>

        <mime-type>application/octet-stream</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>gif</extension>

        <mime-type>image/gif</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>gtar</extension>

        <mime-type>application/x-gtar</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>gz</extension>

        <mime-type>application/x-gzip</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>hdf</extension>

        <mime-type>application/x-hdf</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>hqx</extension>

        <mime-type>application/mac-binhex40</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>htc</extension>

        <mime-type>text/x-component</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>htm</extension>

        <mime-type>text/html</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>html</extension>

        <mime-type>text/html</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>hqx</extension>

        <mime-type>application/mac-binhex40</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>ief</extension>

        <mime-type>image/ief</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>jad</extension>

        <mime-type>text/vnd.sun.j2me.app-descriptor</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>jar</extension>

        <mime-type>application/java-archive</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>java</extension>

        <mime-type>text/plain</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>jnlp</extension>

        <mime-type>application/x-java-jnlp-file</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>jpe</extension>

        <mime-type>image/jpeg</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>jpeg</extension>

        <mime-type>image/jpeg</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>jpg</extension>

        <mime-type>image/jpeg</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>js</extension>

        <mime-type>text/javascript</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>jsf</extension>

        <mime-type>text/plain</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>jspf</extension>

        <mime-type>text/plain</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>kar</extension>

        <mime-type>audio/x-midi</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>latex</extension>

        <mime-type>application/x-latex</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>m3u</extension>

        <mime-type>audio/x-mpegurl</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>mac</extension>

        <mime-type>image/x-macpaint</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>man</extension>

        <mime-type>application/x-troff-man</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>mathml</extension>

        <mime-type>application/mathml+xml</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>me</extension>

        <mime-type>application/x-troff-me</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>mid</extension>

        <mime-type>audio/x-midi</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>midi</extension>

        <mime-type>audio/x-midi</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>mif</extension>

        <mime-type>application/x-mif</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>mov</extension>

        <mime-type>video/quicktime</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>movie</extension>

        <mime-type>video/x-sgi-movie</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>mp1</extension>

        <mime-type>audio/x-mpeg</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>mp2</extension>

        <mime-type>audio/x-mpeg</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>mp3</extension>

        <mime-type>audio/x-mpeg</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>mp4</extension>

        <mime-type>video/mp4</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>mpa</extension>

        <mime-type>audio/x-mpeg</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>mpe</extension>

        <mime-type>video/mpeg</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>mpeg</extension>

        <mime-type>video/mpeg</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>mpega</extension>

        <mime-type>audio/x-mpeg</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>mpg</extension>

        <mime-type>video/mpeg</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>mpv2</extension>

        <mime-type>video/mpeg2</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>ms</extension>

        <mime-type>application/x-wais-source</mime-type>

    </mime-mapping>

    <mime-mapping>

        <extension>nc</extension>

        <mime-type>application/x-ne

分享到:
评论

相关推荐

    struts2文件上传下载源代码

    5. **错误处理**:确保添加错误处理机制,比如检查文件类型、大小是否合规,以及上传过程中可能出现的任何异常。 文件下载功能则涉及从服务器向用户设备发送文件。Struts2提供了`StreamingAction`,它允许你直接从...

    struts2实现文件上传下载

    在处理文件上传时,务必注意安全问题,防止文件覆盖、非法文件类型上传以及恶意代码注入。可以通过验证文件扩展名、限制文件大小和类型,以及将上传的文件保存到指定的安全目录来提高安全性。 6. **优化与拓展** ...

    struts2_uploadify带进度条的多文件上传下载

    Uploadify还支持多文件选择、文件类型过滤、上传失败重试等特性。 在本项目中,"upload.sql"是一个包含SQL语句的文件,通常用于创建或初始化数据库表结构。由于提到使用MySQL数据库,这个SQL文件可能是用来创建与...

    struts2框架下的文件上传

    - 文件类型检查:为了安全,需要验证上传文件的类型,防止恶意文件上传。 - 错误处理:确保捕获并处理可能出现的异常,如文件过大、格式错误等。 - 文件存储位置:确定服务器上的存储路径,避免文件覆盖或权限问题。...

    Struts2 文件上传之文件类型 allowedTypes.txt

    上述提供的部分文件类型映射表中包含了各种文件扩展名及其对应的MIME类型。例如: - `.doc` 对应 `application/msword` - `.pdf` 对应 `application/pdf` 当使用文件扩展名配置`allowedTypes`时,Struts2会根据...

    struts2上传和下载文件详细源码

    在这个"struts2上传和下载文件详细源码"中,我们可以深入理解Struts2如何处理文件上传和下载操作。 1. 文件上传: 在Struts2中,文件上传主要依赖于Apache的Commons FileUpload库。首先,需要在struts.xml配置文件...

    struts1和struts2分别实现文件上传下载功能

    例如,`FileUpload`类允许你设置最大上传文件大小,而文件类型检查可以通过检查文件扩展名或MIME类型来实现。 总的来说,Struts1和Struts2在文件上传下载上的实现各有特点,Struts1更注重于配置,而Struts2则提供了...

    struts2文件上传下载

    在这个特定的项目中,我们关注的是"struts2文件上传下载"的功能,这涉及到用户通过Web界面上传文件到服务器,以及从服务器下载文件到用户的设备。 文件上传是Web应用中的常见需求,例如用户可能需要提交图片、文档...

    struts2文件上传,一直报类型不允许的问题

    Struts2 文件上传时遇到“类型不允许的问题”通常与文件扩展名验证有关,这涉及到Struts2框架的安全配置。在Struts2中,为了防止恶意用户上传不安全的文件(如脚本或可执行文件),系统会设定允许上传的文件类型。当...

    struts2 上传下载文件

    使用struts2框架进行文件的上传并限制文件的大小与类型,使用struts2框架实现文件下载

    struts2文件上传和下载

    在Struts2中,文件上传和下载是常见的功能需求,对于用户交互和数据交换至关重要。以下是对这些知识点的详细阐述: 1. **文件上传**: 在Struts2中,文件上传主要依赖于`Commons FileUpload`库,它是一个Apache提供...

    基于Struts2的文件上传下载功能的完整源代码。

    在基于Struts2的文件上传下载功能中,它提供了处理用户上传文件和提供文件下载的服务。这个完整的源代码是实现这些功能的一个实例,经过测试确保了其正确性和可用性。 首先,我们要理解Struts2中的Action类。Action...

    Struts2之struts2文件上传详解案例struts011

    在处理文件上传时,还要注意一些最佳实践,比如验证文件类型、大小,防止上传恶意文件。此外,对于大文件上传,可能需要考虑分块上传和异步上传以优化用户体验。 总结,Struts2的文件上传功能通过Action类、配置...

    struts2实现多文件上传下载

    3.Struts2进行下载处理,能对上传的所有文件进行下载(多个) 4.文件保存的名称UUID生成,不过显示并下载的名称都是原文件名称 (通过UploadFiles处理) 5.对配置文件中的路径可以进行动态读取(不重启服务器) ...

    struts2上传下载项目

    在"struts2上传下载项目"中,我们可以深入理解如何利用Struts2实现文件的上传与下载功能。 首先,上传功能在Web应用中十分常见,比如用户在注册时上传头像,或者提交文档等。在Struts2中,我们主要借助`struts2-...

    struts2 文件上传中 ContentType对应表

    在Struts2框架中,处理文件上传时,需要正确识别文件类型并设定对应的MIME类型(ContentType),这对于确保文件被正确解析至关重要。下面将详细介绍部分常见的文件扩展名及其对应的ContentType,以及这些类型的含义...

    struts实现的文件上传下载功能

    2. **Action类**:在`Action`中,根据请求参数(通常是文件ID或名称)找到文件的位置,并设置响应的头信息,如`Content-Type`(表示文件类型)和`Content-Disposition`(通常设置为`attachment`,使浏览器以附件形式...

    Struts的文件下载

    通过Struts提供的组件和API,我们可以灵活地扩展文件下载功能,满足各种需求。 总结来说,Struts的文件下载功能依赖于自定义Action类、HTTP响应头的设置以及Struts配置文件中的映射规则。通过理解这些核心概念,...

    JavaEE Struts文件上传

    JavaEE Struts 文件上传是Web开发中的...在实际应用中,确保文件上传的健壮性和安全性是至关重要的,比如防止文件覆盖、大小限制、非法文件类型上传等问题。通过实践和不断学习,开发者可以更好地理解和运用这一功能。

Global site tag (gtag.js) - Google Analytics