Possible Duplicate:
C# - Outputting image to response output stream giving GDI+ error
I am converting a base64 string to an image then I am calling
img.Save(context.Response.OutputStream, ImageFormat.Png);
which is working fine locally but gets a GDI+ error when I move it to the dev server. I am guessing that .NET behind the scenes is using a temporary folder to save this to disk and so thats why I am getting the error on dev but not locally.
Is this reasoning for the error correct? Is there another way to truly do it in memory?
The exact error is:
Server Error in '/login.MhacPortal' Application.
A generic error occurred in GDI+.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ExternalException (0x80004005): A generic error occurred in GDI+.]
System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams) +800041
Numina.Framework.Core.handlers.ie7image1.ProcessRequest(HttpContext context) in c:\Builds\1\DigitalRiskTeamProject\Numina.Framework.Dev-MHAC\Sources\Numina.Framework.Core\handlers\ie7image.ashx.cs:37 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +625 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +270Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1