Hi tanveersbu,
You need to change the code ( in C#) from
protected void ExportToImage(object sender, EventArgs e)
{
string base64 = Request.Form[hfImageData.UniqueID].Split(',')[1];
byte[] bytes = Convert.FromBase64String(base64);
Response.Clear();
Response.ContentType = "image/png";
Response.AddHeader("Content-Disposition", "attachment; filename=HTML.png");
Response.Buffer = true;
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.BinaryWrite(bytes);
Response.End();
}
to
protected void ExportToImage(object sender, EventArgs e)
{
string base64 = Request.Form[hfImageData.UniqueID].Split(',')[1];
byte[] bytes = Convert.FromBase64String(base64);
File.WriteAllBytes(Server.MapPath("Images/HTML" + DateTime.Now.ToString("dd_MM_yyyy_HH_mm_ss") + ".png"), bytes);
}
in VB from
Protected Sub ExportToImage(sender As Object, e As EventArgs)
Dim base64 As String = Request.Form(hfImageData.UniqueID).Split(",")(1)
Dim bytes As Byte() = Convert.FromBase64String(base64)
Response.Clear()
Response.ContentType = "image/png"
Response.AddHeader("Content-Disposition", "attachment; filename=HTML.png")
Response.Buffer = True
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.BinaryWrite(bytes)
Response.End()
End Sub
to
Protected Sub ExportToImage(sender As Object, e As EventArgs)
Dim base64 As String = Request.Form(hfImageData.UniqueID).Split(",")(1)
Dim bytes As Byte() = Convert.FromBase64String(base64)
System.IO.File.WriteAllBytes(Server.MapPath("Images/HTML" + DateTime.Now.ToString("dd_MM_yyyy_HH_mm_ss") + ".png"), bytes)
End Sub
So that it is going to save in the project's Images folder.