<%@ Page Language="C#" %>
<%
    try
    {
        String strImageName = HttpContext.Current.Request["OCRResultName"];
        String OCRstring = HttpContext.Current.Request["OCRResultString"];
        byte[] imageBytes = Convert.FromBase64String(OCRstring);
        HttpFileCollection files = HttpContext.Current.Request.Files;
		string strImageSavePath = Server.MapPath(".") + "\\UploadedImages\\";
		if (!System.IO.Directory.Exists(strImageSavePath))
		{
			System.IO.Directory.CreateDirectory(strImageSavePath);
		}
        String strImagePath = strImageSavePath + strImageName;
        using (System.IO.FileStream fs = new System.IO.FileStream(strImagePath, System.IO.FileMode.Create, System.IO.FileAccess.Write))
        {
            fs.Write(imageBytes, 0, imageBytes.Length);
            fs.Flush();
        }
        Response.Write("DWTUploadFileName:" + strImageName);
    }
    catch 
    {
    }
%>