Solved

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

Posted on 2008-10-03
1
2,189 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
1 Comment
 
LVL 26

Accepted Solution

by:
Anurag Thakur earned 500 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now