Re: How to track download file from website?



user2008@xxxxxxxxx wrote:
Hi all,

I want to track how many times visitor download file from my website,
for example, when visitor click on a download link, a ASPX page will be
requested, after that it will redirect to a file stored on my web site,
final visitor will see open/save file dialog,

how to do that, or is there an example code do this work?
thank you,


Um, you kind of gave one answer yourself, didn't you? I mean you can create a 'middle' page, an aspx that logs a 'hit' somewhere like a database; the logging of the count is dependent on where you want it to be stored, just remember to keep it thread-safe (simultaneous updates).


Or, you could put the files in a directory hidden to the outside world, and have the aspx download the file 'manually'. An example of downloading the file is shown here:

http://www.ondotnet.com/pub/a/dotnet/2002/04/01/asp.html

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
.



Relevant Pages

  • Re: IIS 6 Windows 2003 SP1 RC 1289 Download bug
    ... ASPX works fine ... I noticed with compression on you could not type the xp sp2 exe link ... Now i can work on the other bugs in sp1 like the delete / rename bug, ... Just encase anyone reading this wants to know the aspx code to download a ...
    (microsoft.public.inetserver.iis)
  • Re: IIS 6 Windows 2003 SP1 RC 1289 Download bug
    ... What matters is if you have a ScriptMap ... normally a directly static file download UNLESS you have a Scriptmap of .exe ... Of course, files sent via ASPX ... Same static/dynamic download with compression turned off - successful ...
    (microsoft.public.inetserver.iis)
  • Re: IIS 6 Windows 2003 SP1 RC 1289 Download bug
    ... your download is not exactly "direct". ... A "direct" download would be something sent by the IIS static file handler ... the response is subject static and dynamic compression. ... it looks like your ASPX page is causing the problem. ...
    (microsoft.public.inetserver.iis)
  • download text/plain file without .txt extension
    ... download. ... Content-Type: text/plain ... If I access this aspx page with IE, it prompts me if I want to open or save ... the default filename is indeed myfile.lic. ...
    (microsoft.public.dotnet.framework.aspnet)
  • How to track download file from website?
    ... I want to track how many times visitor download file from my website, ... for example, when visitor click on a download link, a ASPX page will be ...
    (microsoft.public.dotnet.framework.aspnet)