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 8956647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:50:02+00:00 2026-06-15T14:50:02+00:00

I am developing a website(an educational system) in JSP, which has a different users

  • 0

I am developing a website(an educational system) in JSP, which has a different users with different accessibility and priority(including teachers, students, managers,…)
Now I want to add some files (e.g. some pdfs) to this website, that only a group of users(e.g. teachers) can download them after logged in to the system. now my Question is how can I prevent others from downloading them by directly typing the file addresses in address bar? In other words I don’t want the users to have access to these files directly by typing URLs

thanks in advance

  • 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-15T14:50:03+00:00Added an answer on June 15, 2026 at 2:50 pm

    You can’t prevent people from downloading a file by entering its URI. That is simply how the web works. (If you don’t want something to be downloaded by anybody, don’t put it somewhere that will give it a URI).

    However, it sounds like your problem is “Preventing people who are not authorised to download a file from downloading a file”, which is a completely different problem.

    There are two basic approaches to solving this type of problem.

    Only make the files available through a script

    First, don’t keep the file under the webroot. Then write a script that:

    1. Checks what file the user wants to download (e.g. via a query string parameter)
    2. Checks if the user is authenticated
    3. Checks if the user is authorized to download the file
    4. Identifies the file type and sends a suitable Content-Type header
    5. Reads the content of the file and outputs that too

    Configure your web server to perform auth/authz

    The specifics of this will depend on the web server software you use. I’ve no idea if there are any methods to tell any server that supports JSP to perform auth/authz using whatever Java login system you are using, but I have done it using Apache/mod_perl in the past.

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

Sidebar

Related Questions

I’m developing a website which allows users to join with GFC (Google Friend Connect).
I am developing a website in which a cookie is set when the user
I'm currently developing a website where users can search for other users based on
We are developing a website which is required some software to install for first
I'm developing a website (in Django) that uses OpenID to authenticate users. As I'm
I am developing website and it has to be viewed in tablet pc. Please
I'm developing some website which is a kind of online workplace, there will be
I am developing a website wherein users are able to add friends. Here, I'm
I'm developing a website which is currently in testing phase. Whenever I make some
I'm developing website where I need to execute one code at particular time. Which

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.