ColdFusion Programming/pdf file access

Advertisement


Question
How can access pdf files but force the user to make sure he logs in before he can access the file.

Thanks for any help.

Answer
The fact you mention "logs in" leads me to believe your site or application is member-based, i.e. already has a log in feature. I would then assume you simply place the pdf link on a protected page.

Otherwise your question is very general and depends deeply on your application, your framework, et al. I'm afraid you'll have to be more specific. But my general answer is:

<cfif user.isLoggedIn()>
<a href="http://pdfLink">Open PDF</a>
<cfelse>
<a href="http://loginLink">Log In First</a>
</cfif>

ColdFusion Programming

All Answers


Answers by Expert:


Ask Experts

Volunteer


Clint Willard

Expertise

I will volunteer to answer your Coldfusion programming questions.

Experience

I am an expert certified Coldfusion MX programmer with experience in Flash, Action Script, Flex, SQL, XML, and other related.

Education/Credentials
Associates in Applied Science and Coldfusion MX certificate.

©2012 About.com, a part of The New York Times Company. All rights reserved.