=======================
string ImageFile = Server.MapPath("Hello.jpg");
System.Drawing.Image objImage = System.Drawing.Bitmap.FromFile(ImageFile);
Response.Clear();
Response.ClearContent();
Response.ContentType = "images/jpeg";
Response.AddHeader("Content-Disposition", "attachment; filename=Image.jpg;");
MemoryStream objMem = new MemoryStream();
objImage.Save(objMem, ImageFormat.Jpeg);
objMem.WriteTo(Response.OutputStream);
//objImage.Save(Response.OutputStream, ImageFormat.Jpeg);
Response.End();
That's It !!
Hope you will like it.
0 comments:
Post a Comment