Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detecting download from a link

Status
Not open for further replies.

dkn

Programmer
Oct 11, 2000
60
0
0
US
Hi,

I'm currently writing a document management system, and want to make a log of all files uploaded and downloaded from the server.

I've got the upload log working ok, but am a bit stuck on the downloads...What I need to know is, is there a way to programatically detect when a file has been downloaded. I currently have my downloads as a link pointing to the relevant file on the server. Clicking the link pops up the File Download dialog box. Can I tell what action the user takes when presented with the dialog box i.e. does he click Open, Save or Cancel?

Any help greatly appreciated.

David
 
I would think the answer is no, since the File Download dialog box is being displayed by the client machine OS, not the server.
 
You could have the user enter their email address in a form and then email the document to them.
 

You can use redirection for that. You first point to an ASP page with a code or something indicating the file being requested. In that ASP page you can encrement some value in a database or whatever then reply with a HTTP REDIRECT response that points to the actual file.

Or you can send the file bytes from your code. You can do it in ASP using the FileSystemObject. There were several threads on that in recent weeks in this forum. One of them has a reply that references an article on codeguru.com that provides code for using the FileSystemObject to send a MS Word file to the browser from an ASP page.

Once you have that working it is a simple matter to capture the number of times the file has been downloaded.

-pete

 
Thanks for the replies.

I'll have a search through the archives for the thread you mentioned.

Cheers

David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top