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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:07:16+00:00 2026-05-11T04:07:16+00:00

I have a personal project that’s been online for sometime now. I’ve been keeping

  • 0

I have a personal project that’s been online for sometime now. I’ve been keeping a tally of downloads by doing this:

  • When the user clicks the download link, it hits a PHP script that writes some information to a table.
  • Once the data is written, the script returns the path to the actual file.
  • The user then has the ability to save the file to their hard disk as if it was any other download.

This has worked well enough for sometime; however, it prevents users from being able to right-click > save target as... because they’ll actually just see download.php appear in the ‘File Save..’ dialog. Thus, the only way to download the project is to left-click on the link.

I’d like to improve the process so that a user can download the project using whatever method with which s/he is most comfortable. So, what are some better ways to transparently log downloads without getting in the user’s way?

For what it’s worth, the machine is a standard LAMP stack, so no .NET options here.

  • 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-11T04:07:17+00:00Added an answer on May 11, 2026 at 4:07 am

    This is taken from the php-documentation, but is also possible using different script languages:

    <?php // We'll be outputting a PDF header('Content-type: application/pdf');  // It will be called downloaded.pdf header('Content-Disposition: attachment; filename='downloaded.pdf'');  // The PDF source is in original.pdf readfile('original.pdf'); ?> 

    The HTTP-Header Content-Disposition tells it to save it as a download.

    Another option would be to inspect your log-files regularly, like every day using a script.

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

Sidebar

Related Questions

Background I have a personal project that I've been trying to build for around
I have an old personal project written in Java 1.4 that I am porting
For a personal project I have been implementing my own libstdc++. Bit by bit,
I'm currently open sourcing a project that we've been developing on our own personal,
I have a personal project that I'd like to build as an add-in for
I have recently started a personal project that uses ASP.NET MVC (RC1 at the
I'm just doing my personal project that draws a basic map using Swing. I
I have a Mercurial repository for a personal project, and I have been storing
I have begun work on a personal project that may end up having some
I have a project that inserts personal information to a table and details into

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.