I m sending base64string from android app to webservice. webservice converts that base64string into image again. But i m getting below error from web service while converting base64string into image again:
"A generic error occurred in GDI+." this error i m getting on server only.
below is my code:
public string Base64ToImage(string base64String, string imgName)
{
try
{
// Convert Base64 String to byte[]
byte[] imageBytes = Convert.FromBase64String(base64String);
MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length);
// Convert byte[] to Image
ms.Write(imageBytes, 0, imageBytes.Length);
System.Drawing.Image image = System.Drawing.Image.FromStream(ms, true);
image.Save(
"D:\\apps\\PJP_TEST\\PJPTest\\Online\\ImageStorage\\" + imgName);
return "Success";
}
catch (Exception ex)
{
return ex.Message;
}
}