Jump to content

how to detect file download?


realjumper

Recommended Posts

Hi,

My little application is a simple file upload system. There is only ever going to be one user who will upload, and one user who will download the file. There is also an archive of current uploaded files for the download person, and a separate archive page for the uploader which is the same, but includes a delete function to delete the db record and also to delete the actual file. When a file is uploaded, an email is sent to the person who will download the file when he is ready, by visiting the archive page and choosing which file he wishes to dowload and clicking the 'download' link. So far so good.

What I want to do now is to have a 'Yes'/'No' next to the archive of each file which will let the user know whether the file has been downloaded or not. The question is.....how do I detect if the file has been downloaded or not?

Thanks for any suggestions.

Neil
Link to comment
Share on other sites

You can set up a PHP script to feed the browser a download instead of a web page. You just need to set the content-type correctly with the header() function. This script can also record the fact that it was run.

See this page from the PHP documentation for more information:
[a href=\"http://us3.php.net/manual/en/function.header.php\" target=\"_blank\"]http://us3.php.net/manual/en/function.header.php[/a]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.