• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Confirm File was downloaded and by whom?

New Here ,
Aug 12, 2008 Aug 12, 2008

Copy link to clipboard

Copied

Greetings

I use cffile for an administrator to upload documents (PDF) to a repository directory. The name of the file is captured to the DB when uploaded.

I need to confirm if/when an end user has downloaded the document, and any information I can capture (IP address, etc.?) using a yes/no flag field and a field to store IP address? The user's info is already a record in the DB, and their session variable is available at log-in.

Thanks in advance

newportri
TOPICS
Advanced techniques

Views

730

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 13, 2008 Aug 13, 2008

Copy link to clipboard

Copied

What's the part you are having difficulty with?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 13, 2008 Aug 13, 2008

Copy link to clipboard

Copied

Dan:

Thanks for your continued help!

I don't know how I would go about confirming that the user actually surfaced the PDF to read it or print it. They could log into the system but not necessarily download documents- I need to have a record that confirms which documents they actually accessed.

Thanks again-


newportri

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 13, 2008 Aug 13, 2008

Copy link to clipboard

Copied

You have to know how your site works. Specifically, you have to know the available methods of downloading documents.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 13, 2008 Aug 13, 2008

Copy link to clipboard

Copied

Dan:

The administrator uploads all the documents to a repository. The name of the document (whatever.pdf) is sent to the DB in a field named "FileContents" along with all the information about it, creating a record.

Later, a user logs on and can now see a link to the document - something like

<cfquery name="surface" datasource="#Request.BaseDSN#">
SELECT new_bid_ID, FileContents
FROM Bid
WHERE new_bid_ID = 388
</cfquery>

<cfoutput query="surface"><a href="bids/documents/#FileContents#" target="_blank">Click Here to see this document</a></cfoutput>

Is there any way to confirm that a logged-in user hit the link?

Thanks again

newortri

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 13, 2008 Aug 13, 2008

Copy link to clipboard

Copied

The answer is in the anchor tag. Instead of going straight to the document, go to a cf page that allows you to collect your data before showing the pdf to the user.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 13, 2008 Aug 13, 2008

Copy link to clipboard

Copied

Dan:

Sorry to ask an assuredly simple question, but would the page simply carry out some processing then cflocation or would the user need to take additional action?

There is a session variable "Session.user_id" floating around- So it would need to be an update action- updating a yes/no field like:

UPDATE ****
SET didthedocgetopened = yes
WHERE Session.user_id = #Session.user_id#

?

Thanks......

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 13, 2008 Aug 13, 2008

Copy link to clipboard

Copied

LATEST
quote:

Originally posted by: newportri
Dan:

Sorry to ask an assuredly simple question, but would the page simply carry out some processing then cflocation or would the user need to take additional action?

There is a session variable "Session.user_id" floating around- So it would need to be an update action- updating a yes/no field like:

UPDATE ****
SET didthedocgetopened = yes
WHERE Session.user_id = #Session.user_id#

?

Thanks......

Ian answered the first part.

For logging, I would be adding records, not updating them. That enables you to not only see who accessed the file, but how often.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 13, 2008 Aug 13, 2008

Copy link to clipboard

Copied

newportri wrote:
> Dan:
>
> Sorry to ask an assuredly simple question, but would the page simply carry out
> some processing then cflocation or would the user need to take additional
> action?
>

It could, but the usual solution is to use the <cfcontent...> tag to
deliver the desired content, the PDF document in your example, after all
desired logging and other processing.

It also allows for the PDF documents to not be in a web accessible
directory so that intelligent users can not by pass your security and
logging to directly access the document with a browser.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation