
Response.Redirect problem...
I'm trying to log each access/download of a pdf file. When the user selects
the link, instead of being a link to the pdf file, it calls another asp script
which logs the download into the database then uses Response.Redirect to
actually access/download the file.
This seems to work fine using Netscape and IE3, but IE4 & IE5 seems to download
the pdf file in segments and logs the download several times.
I'm using IIS5/WIN2kSever. Below is a snippet of code, does anyone have a
better way of doing this?
Thanks.
Dim DbConn, SQL, RS, fname, description, dl_type
fname = Request.QueryString("Filename")
dl_type = Request.QueryString("Type")
description = Request.QueryString("Description")
Set DbConn = Server.CreateObject("ADODB.Connection")
DbConn.Open "dsn=DOWNLOADED;uid=xxxx;pwd=xxxxx"
SQL = "INSERT INTO downloaded (username, file_type, file_desc, file_name,
dl_date) values (" _
& "'" & Session("User") & "', " _
& "'" & dl_type & "', " _
& "'" & description & "', " _
& "'" & fname & "', " _
& "'" & Now & "')"
RS = DbConn.execute(SQL)
DbConn.Close
Response.Redirect fname