Mime Type and file suffix comparison table and method for detecting file mime

Source: Internet
Author: User
Tags comparison table
Note: I just wrote an article titled ihttphandler (2): anti-leech! My resources can only be downloaded by my users. The URL is http://blog.csdn.net/zhoufoxcn/archive/2008/01/11/2018.5.aspx. It is estimated that many friends are not familiar with the MIME types corresponding to files with different suffixes (in fact, I cannot remember so many ), therefore, I have written a table of MIME types corresponding to some common file suffixes, And I will present them to you:

File suffix Mime Remarks
*.avi video/x-msvideo Video Files
*.aif *.aiff *.aifc audio/x-aiff Sound file
*.au*.snd audio/basic Sound file
*.ai*.eps*.ps application/postscript  
*.asd *.asn application/astound  
*.bin *.exe *.com *.dll *.class application/octet-stream Binary data file
*.bin application/x-macbinary  
*.csv text/comma-separated-values  
*.css text/css CSS (style sheet file)
*.dwg application/acad AutoCAD File
*.dxf application/dxf AutoCAD File
*.dcr *.dir *.dxr application/x-director  
*.doc *.dot application/msword Word Files
*.gz application/gzip GNU compressed file
*.gif image/gif  
*.hlp *.chm application/mshelp  
*.htm *.html *.shtml text/html  
*.js text/javascript  
*.jpeg *.jpg *.jpe image/jpeg  
*.mpeg *.mpg *.mpe video/mpeg  
*.mp3 Audio/MPEG  
*.qt *.mov video/quicktime  
*. MDB Application/msaccess  
*.ppt *.ppz *.pps *.pot application/mspowerpoint  
*.pdf application/pdf  
*. Rar Application/octet-stream  
*.rtf application/rtf  
*.rtx text/richtext  
*.ram *.ra audio/x-pn-realaudio  
*. RM *. rmvb Application/vnd. Rn-RealMedia  
*.swf *.cab application/x-shockwave-flash  
*.Txt Text/plain  
*.xls *.xla application/msexcel  
*.z application/x-compress  
*.zip Application/X-zip-compressed  
Note: The comparison between commonly used file formats and Mime is listed above. If you encounter uncommon file formats during actual development, you do not need to worry about them, use the fileupload component of Asp.net to easily drag a fileupload component to the web form and add a button. The Click Event code of the button is as follows:
Protected void btnupload_click (Object sender, eventargs E)
{
If (fileupload1.hasfile)
{
Response. Write ("mime =" + fileupload1.postedfile. contenttype );
}
.

This article is from the "Zhou Gong (Zhou Jinqiao) column" blog, please be sure to keep this source http://zhoufoxcn.blog.51cto.com/792419/167035

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.