Is there a way to password protect images on a web server?

by on December 27, 2009

Q: Normally, when we upload an image to a server it is viewable to all. Is there a way that we restrict an image to be view (to until they login as a membership).


3 Responses to “Is there a way to password protect images on a web server?”
  1.  

    You can do this a few different ways and it will depend on what operating system and web server you are using. If you are using Apache, for example, you can use mod_auth to password protect a directory. This is a pretty quick and easy way to get started but it is difficult to manage as the number of users increase.

    The other option would be to get a programmer to write code in ASP, PHP, perl, or any other number of languages that would manage the access to the images and allow you to setup memberships and charge if need be. Something like this, depending on how complicated you want it, could take anywhere from a few days to a few weeks and could cost a few hundred dollars to a few thousand dollars.

    It is also very possible that you could find some photo gallery software that would do what you need as well. I have not used any software like this myself but I would not be surprised if some searching would turn up something that might do most of what you want.

     
  2.  

    Thanks for your kind Matt.
    I am using asp.net. I found the link which solve the problem, but it only work at client machine not at the remote machine(previledge), because we have to add new extension to IIS.
    http://www.brainbell.com/tutorials/ASP/Implementing_IHttpHandler.html

    Alternative, we can save the image/song/video into database….But I afraid the performance to extract it out as binary is not that great..

     
    •  

      I would not save them in a database either, however, it probably would not be that big of a problem until you get to be really big. I would store them in a directory that is not accessible by the web server and then display them using a script. So something like get_image.asp?image_id=10 and then that would go to the directory and display the image. This would allow you to do your membership/login check using get_image.asp