代码收藏

收集网站开发时常用到的代码(asp,php,js等)

« 自动检测内容是编码进行转换纯ASP代码生成图表函数1——柱状图 »

asp设置文件下载

<%
'asp读取1.swf这个文件,并提供下载,可以让用户无法获知下载文件的实际地址。
Response.Buffer = True
Dim objXMLHTTP, xml
Set xml = Server.CreateObject("Microsoft.XMLHTTP") '创建对象

xml.Open "GET","http://www.itlearner.com/1.swf",False '
'设置对象,具体xmlhttp详细使用方法请见:《XMLHTTP 对象及其方法》一文

xml.Send '发送请求

Response.AddHeader "Content-Disposition", "attachment;filename=banner_k_050202.swf" '添加头给这个文件

Response.ContentType = "application/zip" '设置输出类型

Response.BinaryWrite xml.responseBody '输出二进制到浏览器

Set xml = Nothing
%>

  • 相关文章:

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

日历

最新评论及回复

最近发表

Powered By Z-Blog 1.8 Spirit Build 80605

Copyright 2008 ITlearner. Some Rights Reserved.