Hi,
In my web application, i need to give an option to user to save the Image in his client side by selecting the drives/path and give the file name and save it at the client side.
Currently i am able to save it in the default path on the client side but i need to have the Dialog box open and prompt the user to choose the path and file name.
How to do this ? Can you explain ?
i tried with the following code.
System.IO.MemoryStream ms = new System.IO.MemoryStream();
this.chartBar.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
this.Page.Response.Clear();
this.Page.Response.ClearHeaders();
this.Page.Response.AddHeader("Content-disposition", "attachment; filename=BarChart.png");
this.Page.Response.AddHeader("Content-type", "image/png");
this.Page.Response.BinaryWrite(ms.ToArray());
this.Page.Response.End();
In this code, i hardcoded the filename.Client Browser will give him a message for save/open etc... and if clicks on Save, it will save it to default Download location that already set by the user.
Thanks for your valuable points
In my web application, i need to give an option to user to save the Image in his client side by selecting the drives/path and give the file name and save it at the client side.
Currently i am able to save it in the default path on the client side but i need to have the Dialog box open and prompt the user to choose the path and file name.
How to do this ? Can you explain ?
i tried with the following code.
System.IO.MemoryStream ms = new System.IO.MemoryStream();
this.chartBar.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
this.Page.Response.Clear();
this.Page.Response.ClearHeaders();
this.Page.Response.AddHeader("Content-disposition", "attachment; filename=BarChart.png");
this.Page.Response.AddHeader("Content-type", "image/png");
this.Page.Response.BinaryWrite(ms.ToArray());
this.Page.Response.End();
In this code, i hardcoded the filename.Client Browser will give him a message for save/open etc... and if clicks on Save, it will save it to default Download location that already set by the user.
Thanks for your valuable points