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

  • Home
  • SEARCH
  • 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 792633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:01:23+00:00 2026-05-14T22:01:23+00:00

Lets say I have some pdf files stored on my server and I only

  • 0

Lets say I have some pdf files stored on my server and I only want to allow a person who’s paid have access to download a particular pdf.

So for an example, let’s say I have a bunch of e-books. The only way a user would be able to download e-book A is if his account contains the right credentials for that particular book.

What’s the best way to accomplish this?

Any ideas/advice on how to improve my idea are greatly appreciated!

My current idea:

  • A user places an order

  • Upon success, a new folder would be
    created by their
    /account_num/order_id/ A copy of the
    particular file would be stored in
    this directory

  • Have php generate an .htaccess that
    would only allow access from a url
    that contains a random hash embedded
    into it.
  • The only way a user would be able to
    access this random hashed page is if
    they are signed in as the right user,
    and the hash matches up with the hash
    stored in the database, otherwise
    they are redirected to home page.
  • 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-05-14T22:01:24+00:00Added an answer on May 14, 2026 at 10:01 pm

    Store the PDFs below the document root. When someone wants to download say, A.pdf, direct them to a PHP page like: download.php?file=A.pdf. Write that download.php page to check the requesting user’s privileges, and force a download of A.pdf if their privileges are good enough.

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

Sidebar

Related Questions

Let's say I have a collection of PDF files with the following paths: /some/path/pdfs/birds/duck.pdf
Lets say I have some raster data I want to write to a file..
Lets say I have some binary value: 0b100 and want to convert it to
Lets say we have some basic AR model. class User < ActiveRecord::Base attr_accessible :firstname,
Lets say I have one row with three columns - some buttons on left
Lets say I have a simple 1D array with 10-20 entries. Some will be
I have some PDF's all with two attached files with static names. I would
Lets say I have some random .cs file containing a class with some properties
Lets say I have some domain objects that will need to be serialized/packed using
Lets say we have some text: Lorem ipsum dolor sit amet, consectetur adipiscing elit.

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.