CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    May 2001
    Location
    Mobile, AL.
    Posts
    64

    saving an image file

    I have written an aspx web app which generates a bitmap and then saves it to the images folder. The app works fine when I run it within VS 2005. When I browse to the application using a web url, I get a "Generic error occured in GDI+ when it tries to save the file. The line of code is

    Code:
               imgPath = Server.MapPath("~/images/Brot.bmp")
    <snip>
               PlotBmp(bmp, siz, rectD, 2, imax)
               bmp.save(imgPath)                              '<--Error occurs here.

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto
    Posts
    805

    Re: saving an image file

    have you checked permissions on the /images folder. Making sure the ASP.NET Worker process Or the IUSR Machine account actually has permissions to save the file to this folder.

    A Generic GDI+ error generally means you dont have permissions to write to that folder.

    hth,
    mcm
    rate my posts!
    mcm

  3. #3
    Join Date
    May 2001
    Location
    Mobile, AL.
    Posts
    64

    Re: saving an image file

    What exactly should I check for? I think the settings are the same on on another computer where it actually works.

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto
    Posts
    805

    Re: saving an image file

    check the permissions on the folder where you are storing the images. Make sure your IUSR_MACHINENAME or ASPNET worker process has sufficient rights to write to that folder.

    hth,
    mcm
    rate my posts!
    mcm

  5. #5
    Join Date
    May 2001
    Location
    Mobile, AL.
    Posts
    64

    Re: saving an image file

    I've tried giving all kinds of permissions, but it still doesn't work.

  6. #6
    Join Date
    Jun 2003
    Location
    Toronto
    Posts
    805

    Re: saving an image file

    Quote Originally Posted by bsaucer
    I've tried giving all kinds of permissions, but it still doesn't work.
    Your answer is hardly enough for me to help you. One line answers are not going to yield you much help. How about some specifics regarding your infastructure, the code your using, the ACTUAL permissions you have tried, etc. We are offering help but we are not mind readers, "All kinds of permissions" tells me absolutly nothing.

    mcm
    rate my posts!
    mcm

  7. #7
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: saving an image file

    Also post the IIS settings for the site. Specifically the identity of the application pool that is hosting your application.

    The version of windows also matters.....
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  8. #8
    Join Date
    May 2001
    Location
    Mobile, AL.
    Posts
    64

    Re: saving an image file

    Now that I got it working in XP Pro, how do I get it working in Vista?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured