locked
HttpHandler for Image with URL RRS feed

  • Question

  • User390247913 posted

    I have taken over a project and I ran into a road block yesterday. The current website cleady has a HttpHandler for image retrieval from database and works fine. We are runnning into a situation now to export our data into KML/KMZ files and I am trying to add the imageurl to these files. The user currently logs in the secure website to export KML/KMZ files.

    The current URL for HttpHandler looks like this https://abcd.com/facility.hgx?Id=2357

    2357 is the picture id from the database. When I access this URL it is asking me to sigin to the website to show the picute.

    I tried removing s from https but it redirects me to the https site login screen

    Is there anyway I can expose the HttpHandler so that it won't ask for the login and just returns the image?

    Thanks in advance

    Sri

    Tuesday, December 11, 2012 5:40 PM

Answers

  • User1779161005 posted

    Ok, so find out why you're getting access denied -- i'm going to guess it's because of an <authroization> element somewhere in web.config.

    You can set one path to be custom settings in web.config, as such:

      <location path="handler1.ashx">
        <system.web>
          <authorization>
            <allow users="*"/>
          </authorization>
        </system.web>
      </location>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, December 11, 2012 6:16 PM

All replies

  • User1779161005 posted

    Do you really want to do this? I mean, if it requires authentication in the first place then presumably the data is sensitive, no?

    Tuesday, December 11, 2012 5:46 PM
  • User390247913 posted

    Yes, the data is sensitive, We haven't rolled out the website yet to our real clients.

    I am not worried about the security here, just trying to see how I can do this and later we will come up with how to give access to clients etc.

    Tuesday, December 11, 2012 6:10 PM
  • User1779161005 posted

    Ok, so find out why you're getting access denied -- i'm going to guess it's because of an <authroization> element somewhere in web.config.

    You can set one path to be custom settings in web.config, as such:

      <location path="handler1.ashx">
        <system.web>
          <authorization>
            <allow users="*"/>
          </authorization>
        </system.web>
      </location>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, December 11, 2012 6:16 PM
  • User390247913 posted

    That did it, thank you very much.

    Wednesday, December 12, 2012 9:49 AM