貌似不能吧,何况每个浏览器下载提示都不一样,用flash来做保存.
var fr:FileReference=new FileReference();
fr.save(...);
就会弹出这个框。
function openFile() {
var of= new ActiveXObject("MSComDlg.CommonDialog");
//fd.Filter = "图片文件l(*.jpg|*.jpg";
of.Filter = "*.*";
of.FilterIndex = 2;
of.MaxFileSize = 128;
of.ShowSave();//显示保存按钮 }
<%@ WebHandler Language="C#" Class="GetQRImage" %> using System; using System.Web; public class GetQRImage : IHttpHandler, System.Web.SessionState.IReadOnlySessionState { public void ProcessRequest(HttpContext context) { System.Drawing.Image image = (System.Drawing.Image)context.Session["tempImg"]; System.IO.MemoryStream ms = new System.IO.MemoryStream(); image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); context.Response.ClearContent(); context.Response.ContentType = "image/Jpeg"; context.Response.BinaryWrite(ms.ToArray()); image.Dispose(); context.Session.Clear(); } public bool IsReusable { get { return false; } } }
新建一个ashx,插入如上代码,然后在图片下载链接到这个ashx,因为这个ashx只是输出图片的,比aspx效率高
每个游览器的表现的行为都不一样
每个游览器的表现的行为都不一样,这个游览器器实现了可能别的游览器没办法实现