国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > ASP > 正文

ASP實(shí)現(xiàn)強(qiáng)制圖片下載函數(shù)

2024-05-04 10:59:32
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

圖片不進(jìn)行處理,圖片默認(rèn)是用瀏覽器打開(kāi)顯示,如果希望圖片變?yōu)橄螺d可以使用以下代碼

function downloadFile(strFile)    strFilename = server.MapPath(strFile)     Response.Buffer = True    Response.Clear     Set s = Server.CreateObject("ADODB.Stream")    s.Open     s.Type = 1     on error resume next     Set fso = Server.CreateObject("Scripting.FileSystemObject")    if not fso.FileExists(strFilename) then        Response.Write("<h1>Error:</h1>" & strFilename & " does not exist<p>")        Response.End    end if     Set f = fso.GetFile(strFilename)    intFilelength = f.size     s.LoadFromFile(strFilename)    if err then        Response.Write("<h1>Error: </h1>" & err.Description & "<p>")        Response.End    end if     Response.AddHeader "Content-Disposition", "attachment; filename=" & f.name    Response.AddHeader "Content-Length", intFilelength    Response.CharSet = "UTF-8"    Response.ContentType = "application/octet-stream"     Response.BinaryWrite s.Read    Response.Flush     s.Close    Set s = NothingEnd Function

以上所述就是本文給大家分享的函數(shù)了,希望對(duì)大家學(xué)習(xí)asp能夠有所幫助。

您可能感興趣的文章:

ASP 時(shí)間函數(shù)及如何獲取服務(wù)器時(shí)間的寫(xiě)法Asp Split函數(shù)之使用多個(gè)分割符的方法asp與js的類(lèi)型轉(zhuǎn)換函數(shù)介紹asp中的Rnd 函數(shù)ASP轉(zhuǎn)換格林威治時(shí)間函數(shù)DateDiff()應(yīng)用ASP移動(dòng)文件函數(shù)movefile權(quán)限不足的替代方法ASP中實(shí)現(xiàn)的URLEncode、URLDecode自定義函數(shù)asp實(shí)現(xiàn)獲取MSSQL數(shù)據(jù)庫(kù)表指定條件行數(shù)的函數(shù)asp中實(shí)現(xiàn)清除html的函數(shù)asp實(shí)現(xiàn)截取字符串函數(shù)ASP函數(shù)大全解析
發(fā)表評(píng)論 共有條評(píng)論
用戶(hù)名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 香格里拉县| 岚皋县| 江津市| 宣武区| 华容县| 雅江县| 华安县| 明溪县| 安新县| 望城县| 海宁市| 广南县| 玉田县| 平顺县| 濮阳县| 湖州市| 基隆市| 临颍县| 兴义市| 深泽县| 丹棱县| 淳安县| 乌苏市| 英山县| 九龙城区| 保定市| 隆昌县| 静乐县| 浮山县| 保德县| 永仁县| 潞西市| 恩施市| 临安市| 瑞金市| 静乐县| 济源市| 共和县| 江源县| 福建省| 巴彦淖尔市|