Error Saving Images: A generic error occurred in GDI+.

G

Guest

Hi can someone please tell me why I keep getting the following error and how I might fix it

...::ERROR::.
Exception Details: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+

The line causing the problem is outputImage.Save, but I really don't understand why

...::CODE::.
System.Drawing.Bitmap outputImage = new System.Drawing.Bitmap(origBitmap, newWidth, newHeight)
outputImage.Save(Server.MapPath(basePath + System.IO.Path.GetFileName(_FileName.Value)),System.Drawing.Imaging.ImageFormat.Jpeg)

statusinfo.InnerHtml = "Uploaded " + Server.MapPath(basePath + System.IO.Path.GetFileName(_FileName.Value))

Thanks for any help!
 
A

Ashish M Bhonkiya

Hi Tim,

Check out if this help's you to solve your problem
http://aspalliance.com/319

Regards
Ashish M Bhonkiya

Tim::.. said:
Hi can someone please tell me why I keep getting the following error and how I might fix it!

..::ERROR::..
Exception Details: System.Runtime.InteropServices.ExternalException: A
generic error occurred in GDI+.
 
G

Guest

It's strange because it works fine if I point it at a folder in the root directory of the iis server ie: c:/inetpub/wwwroot/image

but as soon as I add a level to the structure the code gets the same message as mentioned above

Any ideas??

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top