locked
Generic GDI+ Error When Project Published To Server RRS feed

  • Question

  • User85803587 posted

    I have a project which the following segment of code is used to convert an image uploaded by the user.  Everything seems to work correctly on my machine when I am testing.  But when I'm running the project after publishing it to the server I receive "A generic error occurred in GDI+."  Below is the method raising the error: 


            // This function will return the source image to a tiff format.  If the format is .tiff, then the function just returns with success.
            public bool Convert_Image_To_Tiff(string str_SourceFile, string DESTINATION_PATH)
            {
                if (Path.GetExtension(str_SourceFile).ToUpper() == ".tiff")                       //The file is already in the format we want
                {
                    File.Copy(str_SourceFile, DESTINATION_PATH);
                    return true;
                }
                else
                {
                    try
                    {
                        using (System.Drawing.Bitmap bitmap_Image = new System.Drawing.Bitmap(str_SourceFile))     //Convert a bitmap instance based on the source file
                        {
                            bitmap_Image.Save(DESTINATION_PATH, System.Drawing.Imaging.ImageFormat.Tiff);    //Save this instance to the destination location and convert the format to that of a tiff
                        }
                        
                        return true;
                    }
                    catch (Exception ex)
                    {
                        obj_Email.Send(obj_Email.Error_Email, "Error in Claims_Upload -> Convert_Image_To_Tiff()", ex.Message + "<br/><br/>" + ex.StackTrace);
                        return false;
                    }
                }
            }



    Wednesday, April 7, 2010 9:17 AM

Answers

All replies

  • User-1659704165 posted

    Hi,

    Seems Permisiion Problem give me More Rights to IIS User and then Chk


    Wednesday, April 7, 2010 10:58 AM
  • User85803587 posted

    Thank you for your response.  I'm not very familar with IIS and security with it.  Under what tab for the website would I want to set the security and what values should I set this to?  I believe I am running IIS 6.

    Wednesday, April 7, 2010 11:39 AM
  • User-1659704165 posted


    Chk "read/write" Permisiion On IIS..


    http://support.microsoft.com/kb/271071

    http://coppermine-gallery.net/tutorial/permissions/iis.php

    chk the above lin k

    Thursday, April 8, 2010 12:27 AM
  • User1211441112 posted

    Persmission issue. Go to website contro panel -> File manager Set write permission

    http://www.asp.net/learn/whitepapers/aspnet-and-iis6/

    Thursday, April 8, 2010 12:41 AM
  • User85803587 posted

    Turns out it was an issue with a folder not being found on the destination path.  Why is it that a Generic GDI+ Error is raised here instead of a File Not Found or something similar?


    Thursday, April 8, 2010 9:45 AM
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, April 9, 2010 1:30 AM