Is there a way to block images from being viewed if not loaded inside a page?

Discussion in 'ASP .Net' started by darrel, Apr 21, 2006.

  1. darrel

    darrel Guest

    Is there a way to prohibit images from being viewed (linked directly to)
    unless they are loaded from a page in my application?

    I'm working on a project where one can create galleries of images. Some of
    these galleries can be PWD protected. Of course, it's easy to protect the
    ASPX files, but the images are just images, so one could send a link to a
    specific image to someone outside of the secured gallery.

    There's nothing terribly high-secure about these images, so it's not a huge
    deal as it is, but if there's a way, I'd be interested in looking into it.

    I know one option is to move the images outside the WWW folder and then
    stream them to the user from a request, but that, obviously, won't allow one
    to see the images on the pages themselves.

    -Darrel
    darrel, Apr 21, 2006
    #1
    1. Advertising

  2. darrel

    casaubon Guest

    You can map the .net process to handle images in iis under
    configuration.
    under home directory go to configuration add the .jpg extensin and map
    it to aspnet_isapi.
    casaubon, Apr 21, 2006
    #2
    1. Advertising

  3. darrel

    Jeff Dillon Guest

    session_onstart

    "darrel" <> wrote in message
    news:uNLZ%...
    > Is there a way to prohibit images from being viewed (linked directly to)
    > unless they are loaded from a page in my application?
    >
    > I'm working on a project where one can create galleries of images. Some of
    > these galleries can be PWD protected. Of course, it's easy to protect the
    > ASPX files, but the images are just images, so one could send a link to a
    > specific image to someone outside of the secured gallery.
    >
    > There's nothing terribly high-secure about these images, so it's not a
    > huge deal as it is, but if there's a way, I'd be interested in looking
    > into it.
    >
    > I know one option is to move the images outside the WWW folder and then
    > stream them to the user from a request, but that, obviously, won't allow
    > one to see the images on the pages themselves.
    >
    > -Darrel
    >
    Jeff Dillon, Apr 21, 2006
    #3
  4. darrel

    Darrel Guest

    > You can map the .net process to handle images in iis under
    > configuration.
    > under home directory go to configuration add the .jpg extensin and map
    > it to aspnet_isapi.


    What would that do, then...only grant permission to image access to IIS?

    How doable is it to do this on Web host's shared servers (ie, not my
    server)?

    -Darrel
    Darrel, Apr 21, 2006
    #4
  5. darrel

    Darrel Guest

    > session_onstart

    Hmm...sounds like to use that I need to then stream everything? Are their
    cons to that method?

    -Darrel
    Darrel, Apr 21, 2006
    #5
  6. darrel

    Andrea Guest

    Hello Darrel,

    You can create your custom http_handler that manage a list of image that
    can be viewed for free
    or extending the idea a select on some datasource that return a boolean value
    if image is available
    without password.

    Andrea
    Andrea, Apr 21, 2006
    #6
  7. darrel

    casaubon Guest

    If you install the mapping asp net form authentication will protect the
    images in the same way it protects the pages. I would think the host
    would be willing to work with you but i guess it depends on the
    company.

    I think that if you take andrees suggestion you will still need to map
    the extension to aspnet_isapi.

    Try it on your local to see how it works.
    casaubon, Apr 21, 2006
    #7
  8. darrel

    Patrice Guest

    >>, won't allow one to see the images on the pages themselves.

    Apart from the other suggestions I'm not sure what you meant. If you use the
    URL to this page in an IMG or whatever less HTML tag it works as expected...

    --
    Patrice

    "darrel" <> a écrit dans le message de news:
    uNLZ%...
    > Is there a way to prohibit images from being viewed (linked directly to)
    > unless they are loaded from a page in my application?
    >
    > I'm working on a project where one can create galleries of images. Some of
    > these galleries can be PWD protected. Of course, it's easy to protect the
    > ASPX files, but the images are just images, so one could send a link to a
    > specific image to someone outside of the secured gallery.
    >
    > There's nothing terribly high-secure about these images, so it's not a
    > huge deal as it is, but if there's a way, I'd be interested in looking
    > into it.
    >
    > I know one option is to move the images outside the WWW folder and then
    > stream them to the user from a request, but that, obviously, won't allow
    > one to see the images on the pages themselves.
    >
    > -Darrel
    >
    Patrice, Apr 21, 2006
    #8
  9. darrel

    Jeff Dillon Guest

    No, you don't need to stream. I just meant that you could force a redirect
    in session_onstart so they couldn't load images unless they were logged in
    properly

    Jeff
    "Darrel" <> wrote in message
    news:...
    >> session_onstart

    >
    > Hmm...sounds like to use that I need to then stream everything? Are their
    > cons to that method?
    >
    > -Darrel
    >
    Jeff Dillon, Apr 21, 2006
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?SklNLkgu?=

    Q: prevent the source code from being viewed

    =?Utf-8?B?SklNLkgu?=, Mar 22, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    511
    Kevin Spencer
    Mar 22, 2005
  2. pauljustin
    Replies:
    1
    Views:
    459
    dorayme
    Jul 20, 2006
  3. Cal Who
    Replies:
    2
    Views:
    286
    Cal Who
    Apr 13, 2010
  4. la_haine
    Replies:
    4
    Views:
    115
    la_haine
    Oct 29, 2003
  5. Aaron Gray

    How to stop source being viewed ?

    Aaron Gray, Nov 11, 2005, in forum: Javascript
    Replies:
    17
    Views:
    171
    Hywel Jenkins
    Nov 11, 2005
Loading...

Share This Page