Error: 'A generic error occured in GDI+' after deploying application on local IIS

Last Reply on Aug 03, 2016 03:32 AM By dharmendr

Posted on Aug 03, 2016 01:22 AM


I am displaying the image in AJAX modal popup on the click event of link button which is converted from byte data fetched from MS SQL DB is happening properly when I run the app from visual studio.

byte[] ImgData = CommonProgs.GetImgData(int Id);
if (ImgData != null)
string strFilePath = Server.MapPath("~/Images/Img.jpeg");

if (File.Exists(strFilePath))
{ File.Delete(strFilePath); }

MemoryStream ms = new MemoryStream(CustImgData);
Bitmap bmp = new Bitmap(ms);
bmp.Save(strFilePath, System.Drawing.Imaging.ImageFormat.Jpeg);


But when I deployed the same app on local IIS as well as on godaddy server it is showing the below error.

You are viewing reply posted by: dharmendr on Aug 03, 2016 03:32 AM.
Posted on Aug 03, 2016 03:32 AM

Hi AjayP,

These are the following cases when you will get error.

1. Folder name is incorrect or it is missing.

2. If it is hosted on server then the folder might not have proper write permissions and hence you need to provide Read/Write permissions to the