加入收藏 | 设为首页 | 会员中心 | 我要投稿 源码网 (https://www.900php.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > Asp教程 > 正文

点击链接弹出保存图片对话框的asp代码 - ASP教程

发布时间:2016-07-31 00:31:37 所属栏目:Asp教程 来源:站长网
导读:call download(server.mappath(./test.jpg)) Function download(File) temp = Split(File, ) filename = temp(UBound(temp)) Set s = CreateObject(adodb.stre
call download(server.mappath("./test.jpg"))
 Function  download(File)
  temp  =  Split(File,  "")
  filename  =  temp(UBound(temp))
  Set  s  =  CreateObject("adodb.stream")
  s.mode  =  3
  s.Type  =  1
  s.Open
  s.loadfromfile(File)
  data  =  s.Read
  If IsNull(data)  Then
   response.Write  "空"
  Else
   response.Clear
   Response.ContentType  =  "application/octet-stream"
   Response.AddHeader  "Content-Disposition",  "attachment;  filename="  &  filename
   response.binarywrite(data)
  End If
  Set  s  =  Nothing
 End Function

(编辑:源码网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读