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

Hi,

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);

ImgModalPopupExtender.Show();

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

Posted on Aug 03, 2016 01:22 AM
Hi @AjayP,
Please try the following

[Solved] ASP.Net AJAX AutoComplete List not displaying when used inside Modal Popup

It might help you.

Cheers Andrea.

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

1. IIS_USRS

2. NETWORK_SERVICE