Solved

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

Posted on 2011-03-21
2
301 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
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.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

910 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

24 Experts available now in Live!

Get 1:1 Help Now