日韩精品中文字幕一区二区-日韩精品中文字幕一区-日韩精品中文字幕视频-日韩精品在线一区二区三区-第一页在线-第一福利视频

當前位置:首頁文章首頁 IT學院 IT技術(shù)

教你通過ASP下載文件(源碼)

作者:  來源:  發(fā)布時間:2011-6-3 16:46:43  點擊:
本文介紹的是通過ASP下載文件(源碼)的實例,希望對大家有所幫助。
Sometimes you want a user to download a binary file instead of opening it inside the browser window.
There are several different ways to accomplish this.
Generically:
<%
FileName = "Document.Doc"
Response.ContentType = "application/octet-stream"
Response.AddHeader "content-disposition", "attachment; filename =" & filename
Set Stream = Server.CreateObject("ADODB.Stream")
Stream.Open
Stream.LoadFromFile Server.MapPath(Filename)
Conents = Stream.ReadText
Response.BinaryWrite Contents
Stream.Close
Set Stream = Nothing
%>

If you know the file type that you would like the user to download, try:
<%
Filename = "document.doc"
Response.ContentType = "application/vnd.ms-word"
Response.AddHeader "content-disposition", "attachment; filename=" & filename
%>
Other Content Types:
vnd.ms-excel - For Excel
vnd.ms-powerpoint - For PowerPoint
vnd.ms-project - For Microsoft Project
pdf - For Adobe Acrobat Documents
rtf - For Rick Text Documents
vnd.lotus-wordpro - For WordPro
vnd.lotus-1-2-3 - For Lotus 1-2-3
vnd.visio - For Visio
jpeg - for JPG Image File
gif - for GIF Image File
png - for PNG Image File

相關(guān)軟件

相關(guān)文章

文章評論

軟件按字母排列: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
主站蜘蛛池模板: 人总要有点爱好,生活才能继续| 生气的形容词| 美女jj| 热带夜| 绿门背后| 好家伙豆瓣| 猎仇者高清完整版| 丛林之王| 抖音网页版登录入口| asshole| cctv17农业农村频道在线直播| 皮肤诊所| 诱惑的艺术| 含锌的食物| 温子仁电影| 新人类男友会触电电视剧免费观看全集| 文艺部面试提问问题| 黄视频在线播放| 借条怎么样才有法律效力| 德鲁| 抗战电视剧大全免费| 啊摇篮电影| 胚胎移植几天就知道成功了| xiuren秀人网最新地址| 中央电视台科教频道| 我仍在此 电影| 微信头像图片2024最新好看| 境界bleach千年血战| 艾希曼| 激情小视频在线| 98372电影| 哈尔的移动城堡日语版在线播放| 间宫夕贵电影| 檀健次壁纸| 眼泪工匠| 真实游戏完整版高清观看| 周传基| 大追捕电影结局| 电影青春期| 林一个人简历资料| 无常电影|