Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2005
    Thanked 0 Times in 0 Posts

    Password Protecting Directories

    My site is on a Windows 2000 Server and does not support .htaccess. Right now I have each page having its own little code at the top password protecting it. My problem is that if someone has a direct link to the images or the PDF documents, they can just download them. Is there a way for me to password protect the directory they are in using asp? I have a whole system setup for multiple members area and a login manager. I am using an access database that is located outside of the web, so it cannot be accessed through the web. I'd love to be able to integrate that with the password protected directories. Any ideas? Thanks.


  • #2
    Regular Coder
    Join Date
    Aug 2002
    Thanked 2 Times in 2 Posts
    If you can't password protect the folder directly you might consider this idea to make the actual locations of your content less able to be detected:

    Serving Dynamic Images from Static Web Pages - 5/24/2000
    Note the Response.Redirect to the filename as the last line of code in /scripts/ShowPictureOfTheDay.asp. Whatever image you need to dynamically display (be it a banner ad, a "Picture of the Day," or a random image), you will always want a Response.Redirect at the end pointing to the image to display.
    And in the static page:
    <IMG SRC="/scripts/ShowPictureOfTheDay.asp">
    J. Paul Schmidt
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Thanked 256 Times in 252 Posts
    This is how you password protect your web directory in IIS.

    Go to Default Web Site property dialog box, Directory Security tab, click [Edit] button for the Anonymous access section, then uncheck the Anonymous access checkbox and check Basic authentication and/or Integrated Windows authentication. See the help section for more details of the options.

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins


    Posting Permissions

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