`

文件格式及相关的response.contentType

阅读更多
转自:http://blog.sina.com.cn/s/blog_64a692be0100hrev.html
Response.ContentType 名称 类型
ai application/postscript
aif audio/x-aiff
aifc audio/x-aiff
aiff audio/x-aiff
asc text/plain
au audio/basic
avi video/x-msvideo
bcpio application/x-bcpio
bin application/octet-stream
bmp image/bmp
cdf application/x-netcdf
class application/octet-stream
cpio application/x-cpio
cpt application/mac-compactpro
csh application/x-csh
css text/css
dcr application/x-director
dir application/x-director
djv image/vnd.djvu
djvu image/vnd.djvu
dll application/octet-stream
dms application/octet-stream
doc application/msword
dvi application/x-dvi
dxr application/x-director
eps application/postscript
etx text/x-setext
exe application/octet-stream
ez application/andrew-inset
gif image/gif
gtar application/x-gtar
hdf application/x-hdf
hqx application/mac-binhex40
htm text/html
html text/html
ice x-conference/x-cooltalk
ief image/ief
iges model/iges
igs model/iges
jpe image/jpeg
jpeg image/jpeg
jpg image/jpeg
js application/x-javascript
kar audio/midi
latex application/x-latex
lha application/octet-stream
lzh application/octet-stream
m3u audio/x-mpegurl
man application/x-troff-man
me application/x-troff-me
mesh model/mesh
mid audio/midi
midi audio/midi
mif application/vnd.mif
mov video/quicktime
movie video/x-sgi-movie
mp2 audio/mpeg
mp3 audio/mpeg
mpe video/mpeg
mpeg video/mpeg
mpg video/mpeg
mpga audio/mpeg
ms application/x-troff-ms
msh model/mesh
mxu video/vnd.mpegurl
nc application/x-netcdf
oda application/oda
pbm image/x-portable-bitmap
pdb chemical/x-pdb
pdf application/pdf
pgm image/x-portable-graymap
pgn application/x-chess-pgn
png image/png
pnm image/x-portable-anymap
ppm image/x-portable-pixmap
ppt application/vnd.ms-powerpoint
ps application/postscript
qt video/quicktime
ra audio/x-realaudio
ram audio/x-pn-realaudio
ras image/x-cmu-raster
rgb image/x-rgb
rm audio/x-pn-realaudio
roff application/x-troff
rpm audio/x-pn-realaudio-plugin
rtf text/rtf
rtx text/richtext
sgm text/sgml
sgml text/sgml
sh application/x-sh
shar application/x-shar
silo model/mesh
sit application/x-stuffit
skd application/x-koan
skm application/x-koan
skp application/x-koan
skt application/x-koan
smi application/smil
smil application/smil
snd audio/basic
so application/octet-stream
spl application/x-futuresplash
src application/x-wais-source
sv4cpio application/x-sv4cpio
sv4crc application/x-sv4crc
swf application/x-shockwave-flash
t application/x-troff
tar application/x-tar
tcl application/x-tcl
tex application/x-tex
texi application/x-texinfo
texinfo application/x-texinfo
tif image/tiff
tiff image/tiff
tr application/x-troff
tsv text/tab-separated-values
txt text/plain
ustar application/x-ustar
vcd application/x-cdlink
vrml model/vrml
wav audio/x-wav
wbmp image/vnd.wap.wbmp
wbxml application/vnd.wap.wbxml
wml text/vnd.wap.wml
wmlc application/vnd.wap.wmlc
wmls text/vnd.wap.wmlscript
wmlsc application/vnd.wap.wmlscriptc
wrl model/vrml
xbm image/x-xbitmap
xht application/xhtml+xml
xhtml application/xhtml+xml
xls application/vnd.ms-excel
xml text/xml
xpm image/x-xpixmap
xsl text/xml
xwd image/x-xwindowdump
xyz chemical/x-xyz
zip application/zip
分享到:
评论

相关推荐

    如何将图片转换成二进制存储

    针对Response.ContentType的值,除了针对图片的类型外,还有其他的类型: Response.ContentType = "application/msword"; Response.ContentType = "application/x-shockwave-flash"; Response.ContentType = ...

    用asp实现网页调用doc附Response.ContentType 详细列表

    微软有篇文章:... response.buffer=true response.contenttype=”application/x-msexcel” dim vntstream set oMyObject=server.createObject(“MyObject.BinRead”)’这个组件后面介绍 

    uploadFile控件上传文件,格式判断

    Response.Write("文件格式不正确"); } else { int defaulsize = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["filesize"]);//取得设置的默认文件的大小 int filesize = (file_...

    文件下载及web文件的contentType类型大全

    OutputStream toClient=new BufferedOuntputStream( response.getOutputStream() );//获取二进制输出流 //读取文件数据 InputStream fis=new BufferedInputStream(new FileInputStream(filePath)); byte[] buffer...

    图片上传控件

    context.Response.ContentType = "text/plain"; HttpPostedFile file = context.Request.Files["Filedata"];//获取上传的文件. string fileName = Path.GetFileName(file.FileName); //获取文件名称. string ...

    asp.net(c#)下读取word文档的方法小结

    Response.ContentType = “Application/msword”; string s=Server.MapPath(“C#语言参考.doc”); Response.WriteFile(“C#语言参考.doc”); Response.Write(s); Response.Flush(); Response.Close(); 第...

    asp.net 文件下载的通用方法

    在asp.net里,你简单在Response中写文件流的话,可能被浏览器误读了,比如说图片或是.htm,会在被浏览器... Response.ContentType = “application/octet-stream”; Response.WriteFile(filename);//Response.

    jsp最详细教程 最容易入门

    JSP 中的文件操作...............................................................166 4.1 File 类.........................................166 4.1.1 获取文件的属性............................................

    ASP。NET技术文档收集

    Response.ContentType 类型大全 IIS 6.0 不能处理未知的 MIME 类型 ASP.NET 2.0中将 GridView 导出到 Excel 文件中 ASP.NET2.0中Gridview中数据操作技巧 GridView经典删除操作,两种方法 揭秘ASP.NET 2.0的Eval...

    asp.net C#实现下载文件的六种方法实例

    代码如下:protected void Button1_Click(object sender, EventArgs e) { /* 微软为Response对象提供了一个新的方法TransmitFile来解决使用Response.BinaryWrite 下载超过400mb的文件时导致Aspnet_wp.exe进程回收...

    ASP.Net下载大文件的实现方法

    2. 根据下载的文件类型来指定 Response.ContentType 。(参考OSChina的这个网址可以找到大部分文件类型的对照表:http://tool.oschina.net/commons) 3. 在每次写完response时记得调用 Response.Flu

    asp导出excel文件最简单方便的方法

    由于excel软件能识别table格式的数据,所以asp只需要输出table格式的html代码,同时设置好contenttype,增加保存为附件的响应头即可将输出的html代码保存为xls文件。 asp导出excel文件源代码如下: 代码如下: <&...

    ajaxfileupload.js

    ajaxfileupload.js可以兼容IE8以下版本实现无刷新的Form提交,上传文件。 这个版本修改了提交后台失败的几个bug 使用是需注意以下几点: 1.调用createUploadForm,此方法中增加了change参数,此参数用户给新生成的...

    MIME类型大全(response.setContentType中MIME参数类型总结)

    MIME类型就是设定某种扩展名的文件用一种应用程序来打开的方式类型,当该扩展名文件被访问的时候,浏览器会自动使用指定应用程序来打开。多用于指定一些客户端自定义的文件名,以及一些媒体文件打开方式

    .net中下载文件的实例代码

    代码如下:protected void Button_Click(object sender, EventArgs e) { /* 微软为Response对象提供了一个新的方法TransmitFile来解决使用Response.BinaryWrite 下载超过400mb的文件时导致Aspnet_wp.exe进程回收而...

    JSF文件下载实现

    JSF实现文件的下载功能 public static void downloadFile(String path,String fileName) { try { // 获得JSF上下文环境 FacesContext context = FacesContext.getCurrentInstance(); // 获得ServletContext...

    ASP.NET中下载文件的几种实例代码

    代码如下: //TransmitFile实现下载 protected void Button1_Click(object sender, EventArgs e) { /* 微软为Response对象提供了一个新的方法TransmitFile来解决使用Response.BinaryWrite 下载超过400mb的文件时...

    asp将table生成excel文件(xls)

    if request(“action”)=1 then Response.ContentType=”application/ms-excel” Response.AddHeader “content-disposition”,”attachment;filename=www.xls” end if %> <!DOCTYPE html PUBLIC “-//W3C//DTD...

    SA-FileUp 文件上传

    Response.Write( strSubItem & "<BR>") Next Next ContentType属性: oFileUp.Form(strFormElement).ContentType 可以得到文件的MIME类型 IsEmpty属性 oFileUp.Form(strFormElement).IsEmpty 可以知道用户是不是...

Global site tag (gtag.js) - Google Analytics