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

當前位置:首頁文章首頁 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
主站蜘蛛池模板: 对你的爱歌词| 恶搞之家有几季| 大学英语综合教程3| 刘何娜| 周星驰原名| 发型图片女2024最新款式| 我的世界,视频| 想要女朋友电影| 念念相忘电影免费观看| 我在碧桂园的1000天| 张紫妍未删减版视频| 最贵的烟前十名| 德鲁| 莫比乌斯电影完整版免费观看| 消防给水及消火栓技术规范gb50974-2014 | 韩红个人资料| 奖励员工的表扬通告怎么写| leslie| 女朋友的舅妈| 金珠和陈诗雅主演的韩剧| 荒野求生电影完整版| 女友电影| 农村gaygayxxx| 火舞俪人 电影| 起底员工上满8小时被扣工资的公司 | 中华英雄何润东| 瑜伽焰口全集 简体字| 徐少强全部电影 | dota2反和谐| 跟班服务| 学前教育科研方法的论文| 张静初吴彦祖演的门徒| 袁鸿| 唐人街探案免费观看完整版| 霹雳火 电影| 任你干视频| 孤战迷城 电视剧| 情事2| 抖音视频怎么下载| 广西都市频道节目表| 超越天堂菲律宾|