Logging HREF Downloads

Results 1 to 2 of 2

Thread: Logging HREF Downloads

  1. #1
    Mike.Small@lloyds.com Guest

    Default Logging HREF Downloads

    My site enables a user to download a file using a simple HREF. How can I perform an additional task to write a log entry to my SQL server table after the user has downloaded the file?

  2. #2
    Join Date
    Dec 1969

    Default RE: Logging HREF Downloads

    Hi,<BR><BR>One way of doing this is to write a redirection asp page. What happens is this....<BR><BR>On your original page with the link, instead of linking to the file directly, link to your new asp file (redirect.asp). If you have multiple links, you could have a link to "redirect.asp?page=downloadthis.htm."<BR><BR>T hen in the redirect.asp file, make sure you just have the script and no HTML (no &#060;head&#062; or &#060;body&#062;). The script would open and save data to your sql database and then end with a response.redirect("download.file"). ALternatively, if you used the multiple link thing, then it would be response.redirect(request.querystring("page")).<BR ><BR>From the users point of view, the link takes them straight to a download file, but actually they are routed through the redirect.asp script where you can do anything you want as long as you do not write any HTML because this will stop the response.redirect from working.<BR><BR>Hope this helps<BR><BR>DC<BR><BR><BR><BR>In this file

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts