> Our client needs a document tracking system, which allows authorized
> users to view PDF files. For legal reasons they want to track 
> the date, time and IP Address of who views these documents.
> 
> This is the code I'm using
> 
> <cfquery datasource="theDB" name="logDocView">
>   INSERT into docLog
>   (documents_ID, dateViewed, ipAddress)
>   VALUES
>   (#DocID#, #CreateODBCDateTime(now())#, '#CGI.remote_addr#')
>  </cfquery>
> 
> <cflocation url="documents/#docFilename#">
> 
> When we run this query, we end up with three records in the 
> database. If I do a CFLocation to a CFM file instead of a PDF 
> file I only get one record inserted. Plus if I remove the 
> CFLocation and replace it with a <a href> it also inserts just 
> one record. Grrrr!

I suspect that this is due to a peculiarity with PDF files, in that the
client may intentionally make multiple requests for the same file. A few
years ago, I ran into a problem with an application that used CFLOCATION to
redirect to PDF files, and depending on the version of Acrobat used to
create the files, various things might happen - the redirection might work
or might not work at all!

My workaround for this was to use client-side redirection for PDF files
using JavaScript and/or META tags.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to