国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 龙州县| 黔西| 青浦区| 景德镇市| 伊宁市| 五峰| 南川市| 伊金霍洛旗| 抚顺市| 曲麻莱县| 深泽县| 华蓥市| 报价| 大同县| 怀柔区| 景德镇市| 石家庄市| 伊宁市| 广宁县| 德惠市| 泸水县| 厦门市| 中西区| 招远市| 古交市| 汾西县| 都昌县| 平安县| 昔阳县| 祁连县| 阆中市| 资中县| 富顺县| 上思县| 岳阳市| 黑河市| 清镇市| 清镇市| 翁源县| 浦北县| 龙岩市|