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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:31:43+00:00 2026-06-11T22:31:43+00:00

I am making a project for a temporary download link for me to protect

  • 0

I am making a project for a temporary download link for me to protect the file from hotlinkers…

I believe that this is possible to do so.. because we all know that many of file sharing site “don’t wanna mention any“… their link for the file has expiration…

Ex.

If I download one file from their site they give a direct link to click it right?
but then that link will expire right after a few hours or minutes.

How should I know that the link was expired? If I copy the same link on my download manager after one day, it can’t download the same file.

I already made this possible in htaccess.

Ex.

RewriteRule .*\.(rar|ZIP)$ http://domain.com [R,NC]

if they copy the direct link in the address bar of the browser they will be redirected in http://domain.com

But then if they copy the direct link on their download manager the file will be downloaded.

What if they post the link into any other site like forum website, blog, etc.,
and ask the reader to copy and paste the link into their download manager, so that they can download it directly.

This is the problem I want to prevent to protect my file. I am doing this on PHP but I can’t figure it out…

Your help is very much appreciated.

  • 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-11T22:31:44+00:00Added an answer on June 11, 2026 at 10:31 pm

    Use some code like this

     $path="uploads/";
                      $actualfilename=$path.$filename;
                      $fakefilename="downloadfile.pdf";
                       if($typeofview=="download") {
                              @readfile($actualfilename);
                            header('Content-type: application/pdf');
                            header('Content-Disposition: attachment; filename="' . $fakefilename . '"');
                            header('Content-Transfer-Encoding: binary');
                            header('Content-Length: ' . filesize($actualfilename));
                            header('Accept-Ranges: bytes');
                            exit;
    

    add this to your .htaccess file

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule fakefile.php(.*)$ orignalfile.php?$1 [L,QSA]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have searched all over the web with no luck of making this project
I am making a PHP script that will download a file given a name
I'm making a project that will scrap information about a movie and return all
I am making this project that allows the player to push objects. I can
I have a little problem, I'm making project and I'm sending data from client
I am making a project that should compile on Windows and Linux. I have
I am making a project where i am drawing waveform of an audio file
I have an AS3 project making use of compile time constants. This has worked
I'm making a web project that is fitted to the iPad screen. I'm trying
I'm making this little project with fwrite (long story, and I can't use DB's).

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.