Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 How can I count downloads?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

OneWayMule
Dev. Team Member & Support Moderator

Austria
4969 Posts

Posted - 23 June 2001 :  03:08:41  Show Profile  Visit OneWayMule's Homepage  Send OneWayMule an ICQ Message
I saw a script somewhere but couldn't get it working.

Does anyone know/have a script (maybe w/database) that counts downloads?

Thanks

[edit]
Oh, forgot to say it should just count the click, not if the downloads complete.
[/edit]



Edited by - OneWayMule on 23 June 2001 03:11:43

gor
Retired Admin

Netherlands
5511 Posts

Posted - 23 June 2001 :  03:29:43  Show Profile  Visit gor's Homepage
The Linkmanager MOD counts hits, but if it is a link to a file, it count downloads (see: http://www.calvsa.net/snitz/).
Same thing does the script we use on the download pages (http://forum.snitz.com/archive/), you can get that one here: http://www.ymonda.co.uk/

Pierre
Join the Snitz WebRing
Go to Top of Page

MorningZ
Junior Member

USA
169 Posts

Posted - 23 June 2001 :  13:02:28  Show Profile  Visit MorningZ's Homepage  Send MorningZ an AOL message
i use this

Database
i have a 5 col table named TrackDownload that has
DownloadID - Primary Key
DownloadTime - Just to track Time
DownloadIP - Get Users IP Addy
DownloadFile - File Name
DownloadFolder - Folder name

link
http://www.morningz.com/mz/utils/download/getfile.asp?file=/mz/files/public/system_morningztheater.mpeg

ASP code for "getfile.asp" minus my connection object

<%
Dim sFile
sFile = Request.QueryString("file")

'Find the last "/" so we can determin the folder and file name
nDelim = InstrRev( sFile, "/" )

strFile = Mid( sFile, nDelim + 1 )
strFolder = Left( sFile, nDelim - 1 )

strSQL = "INSERT INTO TrackDownload ( DownloadIP, DownloadFile, DownloadFolder, DownloadTime ) VALUES ( '" & _
Request.ServerVariables("REMOTE_ADDR") & "', '" & strFile & "', '" & strFolder & "', '" & _
Now() & "' )"
objConn.Execute strSQL

Response.Redirect sFile
%>


if you need any further clarifications/help, feel free to email me







Edited by - MorningZ on 23 June 2001 13:03:46
Go to Top of Page

mafifi
Junior Member

USA
308 Posts

Posted - 24 June 2001 :  12:34:20  Show Profile  Send mafifi an ICQ Message
MorningZ,

Very nice code snippet. It worked for me.

Thanks,

Mo

Edited by - mafifi on 24 June 2001 12:34:46
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.36 seconds. Powered By: Snitz Forums 2000 Version 3.4.07