Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

A generic error occurred in GDI+. at System.Drawing.Image.Save

Posted on 2008-10-03
1
Medium Priority
?
2,265 Views
Last Modified: 2008-12-29
i am using Windows Server 2008 with IIS7, so the previous solutions to this problem don't seem to apply. This code worked on windows 2003.  But something is different for windows 2008.  I am trying to save a bitmap image to a folder on the webserver using the c# code as follows:

newBitmap.Save("E:\\wpstore\\s_image\\test.png", ImageFormat.Png);

The error message is:
System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams) at ASP.ecards_ecard_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer)


This error code is usually related to permissions for the ASPNET account.  However, IIS7.0 uses ASPNET account control in a different way.

I have looked at the physical path, the permissions, etc.  but apparently there is something different on windows server 2008 IIS7 that is preventing me from saving the image.

Does anyone have experience with Windows 2008 server IIS7.0 and saving images??


0
Comment
Question by:21wpnet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 26

Accepted Solution

by:
Anurag Thakur earned 2000 total points
ID: 22639786
give full right to the following users on the folder where you want ot save and then try again
IIS_IUSERS, IUSR_MachineName
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question