Web. xml File <mime-mapping>

Source: Internet
Author: User

http://blog.csdn.net/sccemstanford/article/details/9064155

————————————————————————————————————————————————————————————————————————————————

Recently done Jeecms project found using IE9 download files (doc,docx etc.), the browser sometimes directly open the file display garbled sometimes can download but after downloading is a folder is inside a bunch of XML files (Microsoft Office Store file information mainly in XML file storage), Later the trace code discovery background default is to output the file in text format, and then open the Web. xml file Discovery

< mime-mapping >          < extension >doc</extension>          <Mime-type  >application/zip</mime-type>  </  Mime-mapping>

, when I downloaded the doc file, the default is downloaded as a zip document, no wonder sometimes the downloaded file as a bunch of XML files, so reconfigure some of the popular document download MIME format, and see the <mime-mapping> The role of the--mime-mapping element maps MIME types to extensions, which are used to specify the download format for this record:

<!--automatically assemble the appropriate MIME suffix for the downloaded file -      <mime-mapping>          <extension>Doc</extension>          <Mime-type>Application/vnd.ms-word</Mime-type>        </mime-mapping>            <mime-mapping>           <extension>Xls</extension>           <Mime-type>Application/msexcel</Mime-type>       </mime-mapping>            <mime-mapping>           <extension>Ppt</extension>         <Mime-type>Application/vnd.ms-powerpoint</Mime-type>      </mime-mapping>            <mime-mapping>          <extension>Docx</extension>          <Mime-type>Application/vnd.openxmlformats-officedocument.wordprocessingml.document</Mime-type>      </mime-mapping>            <mime-mapping>          <extension>Pptx</extension>          <Mime-type>Application/vnd.openxmlformats-officedocument.presentationml.presentation</Mime-type>      </mime-mapping>            <mime-mapping>          <extension>xlsx</extension>          <Mime-type>Application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</Mime-type>      </mime-mapping> 

<mime-mapping> in the Web. xml file;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.