Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7883529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:33:22+00:00 2026-06-03T04:33:22+00:00

I have a folder in my site which contains files I don’t want users

  • 0

I have a folder in my site which contains files I don’t want users to browse to via the browser so I put this into my web.config

<location path="documents">
    <system.web>
      <authorization>
        <deny users="*"/>
      </authorization>
    </system.web>
    <system.webServer>
      <directoryBrowse enabled="false" />
    </system.webServer>
  </location>

Problem is that on some pages in my site I have links to these very documents and I DO want users to be able to see those documents when they click on them. The problem is that at present when they click on these links they don’t get the documents. This, I do understand, is a contradictory state of affairs. The only thing in my favour is that when the user clicks on a link he will be logged in. Is there some way this can be solved?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T04:33:24+00:00Added an answer on June 3, 2026 at 4:33 am

    The way I would do it is with a page that receives as a parameter some ID to the file you’re trying to get (the filename itself is also ok if it’s not a security breach on its own) that checks the user’s credentials and access to the file in code behind, then overwrites the output with the contents of the file (so loaded on the server side).

    This way the client never needs access to the confidential folder at all, all communications go through your web page and through your credentials checking algorithm. Even if they get a valid link from someone and they don’t have access to it, they’ll get a request denied screen (or whatever you choose to code in).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have this url: http://site.example/dir/ In this folder I have these files: test.ascx.cs
I have a folder within a site that is a seperate web app than
I have a folder on my site for caching large flash movies and I
I have a folder in the root directory of a wordpress site. As such,
I am building a new site, and I have a folder on desktop with
I have a solution with a number of libraries + web site on folder.
I have folder home/admin. In this folder there is index.php. When i access to
I have a site which is in online, two days back i create a
I have a custom gem which is built on the following structure of files:
I have several sections and subsections of my MVC site, which I would like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.