I don't mind that actually.

<!----------------//------
andy matthews
web developer
certified advanced coldfusion programmer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--------------//--------->

-----Original Message-----
From: Bobby Hartsfield [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 06, 2006 11:44 AM
To: CF-Talk
Subject: RE: Password access for PDF files


Oops... That will force the user to download the file.... not open it in
their browser.

...:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com






-----Original Message-----
From: Bobby Hartsfield [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 06, 2006 12:39 PM
To: CF-Talk
Subject: RE: Password access for PDF files

First store the files you want to 'lock' outside of the webroot so no one is
going to guess a link to them or share it once they have downloaded it.

Next, write a form that asks for all the information you want to store in
the database.

When the form is submitted, validate your fields and then use cfheader and
cfcontent to push the file to the user

I use a random file name to give the user so they don’t even know the
original file name (like it matters since they are stored outside the
webroot though)

So basically...


<cfif FORM FIELDS ALL CHECK OUT OK>
<cfset tempname = randrange(11111, 99999) & ".pdf" />

<cfheader name="Content-disposition" value="attachment;filename=#tempname#">
<cfcontent type="application/pdf" file="d:\full\path\to\file.pdf">
</cfif>



....:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com





-----Original Message-----
From: Andy Matthews [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 06, 2006 11:27 AM
To: CF-Talk
Subject: Password access for PDF files

I'm working on a simple access for PDF files and HTML page on my client's
website. There's nothing sensitive about them, they just want to start
collecting user info. So my thought is to have an intermediate page which
checks to see if the user is logged in; stores info about the "view" in the
database; then redirects the user to the page/file. Problem is that I just
tried it and it tried to view it in the browser, not just the PDF but the
underlying source code.

So I'm wondering what might be the best way to do this. My requirements are:

1) User must log in to view anything inside the "library". At this point the
various files and pages are in various directories, but if needed I could
consolidate them all into a "library" directory.

2) Store information about the "view" in the database.

3) Redirect user to the appropriate file.


Thoughts?

<!----------------//------
andy matthews
web developer
certified advanced coldfusion programmer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--------------//--------->








~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:252239
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to