Solved

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

Posted on 2011-03-21
2
304 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
ID: 35180163
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
ID: 35180203
Thank you so much!
0

Featured Post

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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.
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

821 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