图片另存为怎么实现?

kingapex1 2004-08-11 10:21:37
<a href="#" onclick=document.execCommand("saveAs")>另存为</a>
可以实现整个网页的另存为

如果要实现 一个图片的另存为或 下载的功能怎写?
...全文
247 8 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
kingapex1 2004-08-11
  • 打赏
  • 举报
回复
up
kingapex1 2004-08-11
  • 打赏
  • 举报
回复
请教楼上的 下载怎么做 ?
cuixiping 2004-08-11
  • 打赏
  • 举报
回复
下载好说,就是这个另存为俺目前还不知道咋整,关注。
kingapex1 2004-08-11
  • 打赏
  • 举报
回复
晕,好像我想这么做似的
是客户非要实现 不过 找到办法了:

<%
function dl(f,n)

on error resume next
Dim S
Set S=CreateObject("Adodb.Stream")
S.Mode=3
S.Type=1
S.Open
S.LoadFromFile(server.mappath(f))
if Err.Number>0 then
Response.Status="404"
else
Response.ContentType="application/*"
Response.AddHeader "Content-Disposition:","attachment; filename=" & n
Range=Mid(Request.ServerVariables("HTTP_RANGE"),7)
if Range="" then
Response.BinaryWrite(S.Read)
else
'S.position=Clng(Split(Range,"-")(0))
Response.BinaryWrite(S.Read)
End if
end if
Response.End
end function

If request("action")="down" Then
call dl(request("path"),"С??.gif")
End If

%>
<a href=?action=down&path=index.gif><img src=index.gif></a>
顺子 2004-08-11
  • 打赏
  • 举报
回复
有簡單的不用,浪費
snowskyplay 2004-08-11
  • 打赏
  • 举报
回复
对呀,用鼠标右键就可以了
satans18 2004-08-11
  • 打赏
  • 举报
回复
晕,有必要吗,直接鼠标右键得了
tp3 2004-08-11
  • 打赏
  • 举报
回复
顶一下

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧