Your shared code ok but one issue here.
Image save as dd-MM-yy hh-mm-ss (16-11-22 11-05-58)
It will be save like Id or emp id then it is possible.
please help sir.
namespace ash_vhcl_entry
{
public partial class cgp : System.Web.UI.Page
{
int empno = 0;
protected void Page_Load(object sender, EventArgs e)
{
empno = Convert.ToInt32(Request.QueryString["Id"].ToString());
Session["EmpId"] = empno;
if (!IsPostBack)
//if(Page.IsPostBack)
{
BindTextBoxvalues();
}
}
[WebMethod()]
public static bool SaveCapturedImage(string data)
{
string fileName = DateTime.Now.ToString("dd-MM-yy hh-mm-ss");
//Convert Base64 Encoded string to Byte Array.
byte[] imageBytes = Convert.FromBase64String(data.Split(',')[1]);
//Save the Byte Array as Image File.
string filePath = HttpContext.Current.Server.MapPath(string.Format("~/Captures/{0}.jpg", fileName));
File.WriteAllBytes(filePath, imageBytes);
return true;
}
}
}