Solved

How do I create a link to a file using ColdFusion Mappings?

Posted on 2011-03-21
2
300 Views
Last Modified: 2013-12-24
I would like to post links to sensitive PDF documents on a password-protected cfm webpage. I do not want to actually post these sensitive PDF files on our website, so I created a CF mapping "/presentations"  which maps to D:\hiddendocs\

What would the link to this file - "D:\hiddendocs\123.pdf" look like?

This does not work:

<a href="/presentations/123.pdf">Download this File</a>
0
Comment
Question by:scooterboogle
2 Comments
 
LVL 11

Accepted Solution

by:
Brijesh Chauhan earned 125 total points
Comment Utility
CF Mappings are used for as below

ColdFusion mappings let the cfinclude and cfmodule tags access pages that are outside the Web root. If you specify a path that starts with the mapping's logical path in these tags, ColdFusion looks for the page using the mapping's directory path.

ColdFusion also uses mappings to find ColdFusion components (CFCs). The cfinvoke and cfobject tags and CreateObject function look for CFCs in the mapped directories.



The above will just point to http://www.yourwebsite.com/presentations/123.pdf, which will NOT work.

For href, you either need to give a absolute URL or a relative URL, you can define the mapping in  Application.cfm / Application.cf  file and then use it as a variable.
0
 

Author Closing Comment

by:scooterboogle
Comment Utility
Thank you so much!
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now