Click here to Skip to main content
15,887,338 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

When i am trying save the image in the server it's throwing below error.

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: 


Line 166:                                    if (objFileUpload.impersonateValidUser())
Line 167:                                    {
Line 168:                                        ImgThnail.Save(Path.Combine(objFileServerImpersonation.FileServerPath(), ThumbnailPath), Img.RawFormat);
Line 169:ImgThnail.Dispose();


i am using impersonate method to validate user credentials to check get the permissions from the server.
Posted
Comments
Menon Santosh 8-Nov-11 0:07am    
plz add few more line of code for solution :)

 
Share this answer
 
Comments
Rajesh Anuhya 8-Nov-11 1:22am    
Good call raja.., +5
Poster can go through the second link to get the soulation
thatraja 8-Nov-11 2:02am    
Hey where were you man? Looks like you're inactive recent days. Busy @ work?
BTW Thank you
Try using using GC.Collect(); after ImgThnail.Dispose();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900