For Programmers: Free Programming Magazines  


Home > Archive > ASP > June 2005 > Counting the number of downloads









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Counting the number of downloads
Luc Dal

2005-06-03, 8:55 am

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


Bob Barrows [MVP]

2005-06-03, 3:55 pm

Luc Dal wrote:
> 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
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Patrice

2005-06-03, 3:55 pm

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...

--

Patrice

--

"Luc Dal" <dal@sped.ucl.ac.be> a écrit dans le message de
news:d7pbuo$rbc$1@ail.sri.ucl.ac.be...
> 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
>
>



Curt_C [MVP]

2005-06-03, 3:55 pm

Stream the document to the client.
That way you can perform any other operations, like hit counts, prior to
feeding it.
http://www.darkfalz.com/1098


--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com


"Luc Dal" <dal@sped.ucl.ac.be> wrote in message
news:d7pbuo$rbc$1@ail.sri.ucl.ac.be...
> 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
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com