When I display an image from a folder using Handler.ashx ans, then try saving the image by right-clicking it, it continues to give me the option “Save as type” of asp.net generic handler and the name of the handler as the file name ..
Bitmap target = new Bitmap(width, height); using (Graphics graphics = Graphics.FromImage(target)) { graphics.CompositingQuality = CompositingQuality.HighSpeed; graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; graphics.CompositingMode = CompositingMode.SourceCopy; graphics.DrawImage(photo, 0, 0, width, height); using (MemoryStream memoryStream = new MemoryStream()) { target.Save(memoryStream, ImageFormat.Png); OutputCacheResponse(context, File.GetLastWriteTime(photoPath)); using (FileStream diskCacheStream = new FileStream(cachePath, FileMode.CreateNew)) { memoryStream.WriteTo(diskCacheStream); } memoryStream.WriteTo(context.Response.OutputStream); } }
above is the handler and
ImageTiff.ImageUrl = "Handler.ashx?p=" + Parameter;
this is the code.
I need to save it with ans image name not as handler.ashx
source share