private int SaveSignatureImageFile(string invNumber, string signature) { int responce = 0; string filePath = string.Empty; try { byte[] bytes = Convert.FromBase64String(signature); Image image; using (MemoryStream ms = new MemoryStream(bytes)) { image = Image.FromStream(ms); string BasePath = WebConfigurationManager.AppSettings["DBAcknowledgementFilePath"] ?? string.Empty; BasePath = Path.GetFullPath(BasePath); filePath = BasePath + Guid.NewGuid().ToString() + "_InvoiceAck_" + invNumber + ".PNG"; image = (Image)(ResizeImage(image, 200, 200)); image.Save(filePath); responce = 1; } if (responce == 1 && filePath != string.Empty) { int docType = FieldType(invNumber); // UpdatetblUserHistLink(filePath, invNumber, "InvoiceAcknowledgement", docType); } } catch (Exception ex) { Errorlog("Save Acknowledgement error on " + invNumber + " this invoice :" + ex.Message); } return responce; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)