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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:06:17+00:00 2026-05-11T15:06:17+00:00

On the current website I’m working on, I’ve got a directory of files for

  • 0

On the current website I’m working on, I’ve got a directory of files for users to download which would be really nice to have some security method other than obscurity 😉

I was wondering if there’s any way to supply login information via PHP to htaccess as though a user were entering it.

Alternately, if anyone knows a better way to secure user downloads using PHP, that’s also acceptable. All of my googling turns up ‘just use htaccess’ which isn’t really helpful, as from the non-savvy user’s point of view, they have to log in twice every time they use the website.

My best guess at doing it exclusively with PHP is to store files above the web root, then copy them to a web accessible folder temporarily, but this seems highly inefficient and I couldn’t think up any way to remove them after the download has finished.

Note: I don’t own the server this is running on and don’t have ssh access to it.

  • 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. 2026-05-11T15:06:17+00:00Added an answer on May 11, 2026 at 3:06 pm

    If files are not too big (Gb) you can always use readfile for file’s download. In this mode you can check user’s auth before, and if it’s ok output file contents to user, otherwise send him to login page.

    With this method you can put your files in protected (with .htaccess) directory so you can be sure that nobody who isn’t authenticated can access them.

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

Sidebar

Related Questions

I would like to list the directory that my current website will be in
Currently I have an input box which has the value Current Website When they
I have a table set in my current website users id username password email
I'm working on emedding SMF users into current website, and I need to make
I have a few classes in my current project where validation of Email/Website addresses
Current tinyMCE version (3.5.2). Hi, I am working on a custom plugin which adds
I am working on a massive site for a client, but their current website
I would like to take our current mobile website and redesign it for iPhone
i have a problem with a asp.net website first i will explain the current
I have a website and it uses a lytebox to show some images and

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.