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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:26:43+00:00 2026-05-17T17:26:43+00:00

when I try to download from some servers, I`m redirected to a download.php page,

  • 0

when I try to download from some servers, I`m redirected to a download.php page, which can contain many things, then the file download starts.

I want to know how to track my downloads using this download.php file. I mean I want to know how to write this file and what are the contents of this file.

  • 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-17T17:26:44+00:00Added an answer on May 17, 2026 at 5:26 pm

    You mean you want to have your own download.php page that is like the one used by so many others? Here is one of mine:

    header('Content-disposition: attachment;filename=file.js');
    header('Content-type: text/javascript');
    readfile($_SERVER['DOCUMENT_ROOT'] . '/_js/file.js');
    

    That’s pretty much it, this will let you download the file. You have to have the correct filename in readfile() and it usually helps to have the correct content type. There are many, so look up the right one depending upon the file type.

    I don’t know how to track whether the user actually downloaded the file .. probably have to look at the server logs or something. It would be very easy to track who got to the download.php page, though. Just have the page stored in your DB and write the number of times the page was viewed +1.

    Here is a pretty nice list of at least some content-types you can use:
    http://www.utoronto.ca/web/htmldocs/book/book-3ed/appb/mimetype.html

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

Sidebar

Related Questions

In my PHP code I try to download a file from a URL starting
Try to download this page: http://www.4shared.com/get/B4AgMkcw/cookies.html I can use wget/firefox to get the whole
I try to download a zip file to android and then extract the zip
I'm using Windows on my servers. I have to periodicly download some file to
When I try to download Java from Oracle I instead end up downloading a
When I have download sample code from this link and than try to build
i'm download DrillDownApp example project from iPhoneSDKArticles i have a problem when i'm try
What I am trying to implement is force download of a file through PHP.
Explain me please how to download a file from a server using SSL (https://).
I'm trying to download a file from the server . While passing a link

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.