TruMan1
TruMan1

Reputation: 36138

Check how many times file downloaded?

I have a zip file on website running on a Windows 2008 / IIS7 server. Is there a way to check how many times that file was downloaded?

Upvotes: 4

Views: 4114

Answers (3)

IT-Consulting
IT-Consulting

Reputation: 11

Or you directly track it with Google Analytics

<a href="http://www.example.com/files/map.pdf" onClick="javascript: _gaq.push(['_trackPageview', '/downloads/map']);"> 

more info on this here.

Upvotes: 1

DmitryK
DmitryK

Reputation: 5582

You can do it in so many ways

(in the order of increasing complexity and stupidity) ;)

  1. Provide direct link to a file and monitor your web logs. You can use a LogParser tool from microsoft to run SQL like queries against the logs to extract data you need.

  2. Don't provide a direct link to a file. Have a button instead. When a button is clicked you increment the counter and serve the file.

  3. You can use URL shortening services (e.g. bit.ly) - they can provide you with the click stats etc

    E.g. if you append a '+' sign to the end of the bit.ly URL you will get the stats. Or you can register on their site.

    As a variation - use your own service. I.e. have a lookup table:

    shortcode1 - Path1\File1.ext
    shortcode2 - Path2\File2.ext
    ...
    shortcodeN - PathN\FileN.ext

    a link to download your zip file will then look like:

    http://www.yoursite.com/getFile.aspx?code=shortcode1

    getFile.aspx gets executed, performs a lookup, updates stats, serves Path1\File1.ext back.

  4. You can use monitoring tools to keep track of which files were uploaded/downloaded E.g. http://www.iis.net/community/default.aspx?tabid=34&g=6&i=1494

  5. Create/Use an ISAPI extension to monitor file downloads

  6. Map .zip extension through ASP.Net in IIS and a corresponding code to properly react and update stats.

Upvotes: 5

user333306
user333306

Reputation:

Yes this information is located in the log files. You can parse it using awstats or webalizer.

Altenatively you can write your own file download counter or create a special download page for your file.

I prefer the last one and most download sites use that simple method.

However to get the most accurate numbers, parse your log files.

Upvotes: 1

Related Questions