国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 阜新市| 宜都市| 汉中市| 长汀县| 左云县| 昌平区| 邯郸市| 淮南市| 禄丰县| 金昌市| 宕昌县| 昌邑市| 巨鹿县| 武夷山市| 洪江市| 嘉禾县| 安达市| 泰安市| 胶南市| 浑源县| 大姚县| 南江县| 即墨市| 盐源县| 宁晋县| 潍坊市| 江津市| 弥勒县| 富蕴县| 博客| 湖口县| 韶山市| 汽车| 天津市| 申扎县| 彝良县| 漳浦县| 河东区| 琼海市| 泰州市| 织金县|