Hi
I'm currently developing a Document Management System, and one of the requirements is to keep a log of all files that are downloaded and uploaded to the server. I'm having problems with creating a download log.
The document detail are displayed in a table, with the download activated by clicking an image, which then displays the standard file download dialog box. I have been trying to use the onclick event of the image to call a function which will write to the log file. However this doesn't appear to work. Here is the code i'm trying to use
<td width="38" align="center"><a href="<%=MySet("DocURL"
%>"><img src="images/sdload_normal.jpg" alt="Download this Document" name="<%=image_name%>" width="34" height="35"
onclick="WriteLog('<%=MySet("DocID"
%>', '<%=MySet("DocURL"
%>')"></a></td>
'WriteLog Function
Sub WriteLog(DocID, DocURL)
set myset = server.createobject("ADODB.Recordset"
MySet.Open "tblTransferLog", MyConnection, 1, 2, adCmdTableDirect
MySet.addNew
MySet("DocID"
= DocID
MySet("MasterFileName"
= upl.ExtractFileName(DocURL)
MySet("PDFFileName"
= "N/A"
MySet("TransferType"
= "DLoad"
MySet("TransferDate"
= Now()
MySet("CDSID"
= Request.ServerVariables("AUTH_USER"
MySet.Update
MySet.close
Set MySet = Nothing
End Sub
Any other ideas how i can approach this??
Thanks
I'm currently developing a Document Management System, and one of the requirements is to keep a log of all files that are downloaded and uploaded to the server. I'm having problems with creating a download log.
The document detail are displayed in a table, with the download activated by clicking an image, which then displays the standard file download dialog box. I have been trying to use the onclick event of the image to call a function which will write to the log file. However this doesn't appear to work. Here is the code i'm trying to use
<td width="38" align="center"><a href="<%=MySet("DocURL"
onclick="WriteLog('<%=MySet("DocID"
'WriteLog Function
Sub WriteLog(DocID, DocURL)
set myset = server.createobject("ADODB.Recordset"
MySet.Open "tblTransferLog", MyConnection, 1, 2, adCmdTableDirect
MySet.addNew
MySet("DocID"
MySet("MasterFileName"
MySet("PDFFileName"
MySet("TransferType"
MySet("TransferDate"
MySet("CDSID"
MySet.Update
MySet.close
Set MySet = Nothing
End Sub
Any other ideas how i can approach this??
Thanks