梅花老大,关于在客户端能不能实现一个图片的另存为的弹出框阿?

nittystone 2003-02-28 10:18:05

我一直觉得只要想到的就能实现.

<input type=button value=保存 onclick=document.execCommand('SaveAs')>
<input type=button value=另存为 onclick=document.execCommand('Saveas',false,'c:\\test.htm')>
<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0></OBJECT>
<input type=button value=另存为 onclick=document.all.WebBrowser.ExecWB(4,1)>
这几个都是网页的。。。如果是图片该怎么弄阿?
...全文
35 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
伟大de虫子 2003-03-01
  • 打赏
  • 举报
回复
用下面的asp程序可以实现:
使用方法:
把下面的程序另存为downimg.asp
再把图片与这个文件放在同一个目录下,然后在IE里输入:
http://xxxx.xxx.xxx/downimg.asp?file=图片名.jpg

(注:此程序有可能下载服务器上的任何文件,要小心使用,注意对要下载的东西进行判断,非图片文件一律不准下载)


---------------------------------------------------------------
<%
call downloadFile(Request("file"))

Function downloadFile(strFile)

strFile=Server.HTMLEncode(strFile)

If Right(strFile,4)<>".jpg" Or Right(strFile,4)<>".gif" Or InStr(strFile,"?")>0 Then
Response.Redirect "about:blank"
Response.End
End If

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.Redirect "about:blank"
Response.End
end if

' 获得文件大小
Set f = fso.GetFile(strFilename)
intFilelength = f.size

s.LoadFromFile(strFilename)
if err then
Response.Write("<h1>错误 </h1>" & err.Description & "<p>")
Response.End
end if

' send the headers to the users browser
Response.AddHeader "Content-Disposition", "attachment; filename=" & f.name
Response.AddHeader "Content-Length", intFilelength
Response.CharSet = "UTF-8"
Response.ContentType = "application/octet-stream"

' output the file to the browser
Response.BinaryWrite s.Read
Response.Flush
' tidy up
s.Close
Set s = Nothing
End Function
%>
nittystone 2003-03-01
  • 打赏
  • 举报
回复
收到,我测试一下哈..
meizz 2003-02-28
  • 打赏
  • 举报
回复
I am sorry, 这个我不会
nittystone 2003-02-28
  • 打赏
  • 举报
回复
简明、完整、全面的安卓开发demo集合,包含如下示例 1、LinearLayout Button、RadioGroup、 CheckBox 2、TableLayout 3、FrameLayout 霓虹灯效果 4、RelativeLayout 梅花效果 5、自定义view跟着触点走的小球 6、 ListView 列表视图 7、WebView web视图 8、ToggleButton 动态布局效果 9、AnalogClock 、 DigitalClock and Chronometer 时钟和数字日期 10、AutoCompleteTextView 根据输入自动补充可能的全部 11、Spinner View 选择框(出框形式选择) 12、DatePicker TimePicker View 日期时间选择器 13、ProgressBar View 普通进度条、显示在标题栏上的进度条 14、RatingBar View 评级 15、 SeekBar 拖动条,音量调节效果 16、ScrollView 、HorizontalScrollView 垂直和水平滚动条 17、ScrollView 、HorizontalScrollView 垂直和水平滚动条 18、ExpandableListView 分组可展开收缩的ListView 19、Notification 状态栏通知 20、GridView、ImageSwitcher 21、SmsManager 消息管理器,发短信(这里是模拟器只能给其它模拟器发短信) 22、Intent Action、Category属性 测试 23、系统 Action、Category属性 24、ClipDrawable 徐徐展开的风景 25、AnimationDrawable 会动的图片 26、Menu、SubMenu、ContextMenu xml配置menu 27、Attribute 自定义view的duration属性 控制图片的透明度 28、Bitmap、BitmapFactory 图形与图像处理 29、Canvas 绘制自定义图形 30、Canvas 采用双缓存实现画图板 31、SharedPreference 简单的key-value数据存取 32、SQLiteDatabase 安卓客户端的嵌入式数据库 33、GestureDetector + ViewFlipper实现翻页效果 34、GestureLiberay 自定义手势 35、GestureLiberay 通过自定义的手势实现用户操作 36、TextToSpeech 语音朗读 37、ContentProvider、ContentResolver 应用之间共享数据 38、 Service 相当于没有界面的activity 39、Activity与Service运行中通信 40、Service 相当于没有界面的activity 41、AIDL Service android中的跨进程调用 客户端,服务端见AidlService 42、BroadcastReceiver 接收广播消息 43、非UI线程中不能操作UI线程中的View测试 44、ImageSwitcher animation gesture实现可以滑动的跑马灯 45、下载状态栏显示下载进度 46、Gallery3d效果 47、ListView 上拉加载更多效果 48、异步加载图片的二级缓存技术 49、QQ的好友列表展示效果 50、Fragment + ViewPager实现tab滑动切换 51、能够显示在桌面前面的的歌词效果 52、activity切换特效

28,390

社区成员

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

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