Counting the number of downloads

L

Luc Dal

Hello

On a site, I've documents that can be downloaded.
To fill the html page, I read a table in an access database and I write my
code
Each document has a title, an url, an id and a variable "counter"
How can I increment the counter (in the database) and open the docuemnt in
the same operation ???
Thanks for your assistance
Luc
 
B

Bob Barrows [MVP]

Luc said:
Hello

On a site, I've documents that can be downloaded.
To fill the html page, I read a table in an access database and I
write my code
Each document has a title, an url, an id and a variable "counter"
How can I increment the counter (in the database) and open the
docuemnt in the same operation ???
Thanks for your assistance
Luc

You can't. You will need two queries: one to perform the increment, and the
other to retrieve the data.

With SQL Server, you could use a stored procedure.

Bob Barrows
 
P

Patrice

Not sure what you meant but my understanding is that the problem might be
that you are using direct links to your documents making uneasy to handle
the download process (as IIS handles this for you and no code is
trigerred)...

Another approach would be to create links to an ASP download page. This page
would then "stream" the file to the browser and would update the counter (as
you'll have now your won code triggered when the user starts the download).

Try :
http://support.microsoft.com/kb/260519/en-us (for raising the download
dialog client side)
http://support.microsoft.com/kb/276488/en-us (for streaming the file)

Addtionaly it allows to put the files outside of the web site and to perform
whatever checks you might want before letting the use download the file...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top