A generic error occurred in GDI+. RRS feed

  • Question

  • User1718943314 posted
    Hi, I am trying to save the image.But runtime error occurs. Code: ms = new MemoryStream(SignatureImage); System.Drawing.Image signatureImage = System.Drawing.Image.FromStream(ms); signatureImage.Save(dbfImagePath +BillNo + date.ToString("ddMMyyHHmmss") + EmployeeCode + "_Sign.gif"); i am getting the path dynamically..(Apps settings) Error: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams) at System.Drawing.Image.Save(String filename, ImageFormat format) at System.Drawing.Image.Save(String filename) Please anybody help me..
    Tuesday, February 24, 2009 11:57 PM

All replies

  • User1105131773 posted

    This is almost always down to not having permissions to save the file to disk - check that the relevent user has permissions on the folder you are saving into.

    Wednesday, February 25, 2009 7:12 AM
  • User1718943314 posted
    thanks for your reply... I am using Windows XP .There is no security issue for the folder...
    Wednesday, February 25, 2009 8:08 AM
  • User1105131773 posted

    Its worth double checking - are you hosting under IIS - if so then remember that the IIS user account will need permissions on the folder (try giving full permissions on the save folder to 'Everyone' to easily test). If you are overwriting an existing file then ensure its not locked. If you are saving onto a network drive this can sometimes cause issues also. Ensure that the directory you are saving to exists - Put the filename you are saving to into a variable, add a watch and ensure that it looks correct.

    Wednesday, February 25, 2009 8:22 AM