Solved

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

Posted on 2008-10-03
1
2,200 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

825 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