Solved

cfinclude with relative path driving me nuts!!

Posted on 2013-06-12
3
399 Views
Last Modified: 2013-07-15
Hi,

I am trying to set a relative path to  the current file and it is not working. I'm not sure what is wrong.

Page I am on: simple_example.cfm
\\server21\file\Editor\OBI_Status_Check-MA\Xinha\examples\simple_example.cfm

trying to get to file:
\\server21\store\team\chart\type\file.cfm

This is what I have:
<cfinclude template="../../../../store/team/chart/type/file.cfm">  
But get an error.
What am I doing wrong??????
0
Comment
Question by:armanbena
3 Comments
 
LVL 25

Accepted Solution

by:
dgrafx earned 500 total points
ID: 39244201
first off I'm assuming the error you refer to is the file cannot be found error - correct?

start with the root - / - a beginning slash means root directory of the website.
in your case what is the path from root to your file?
/store/team/chart/type/file.cfm - is that it? only you can answer that.
I see that both of these files are on "server21" but is this the same website?
If not then that is not going to work - you can only include files from the same website.
you can however setup mappings if a file is outside the website.

good luck
0
 
LVL 43

Expert Comment

by:Rob
ID: 39246757
I agree, looks as if the two files are on different shares which won't work. You can access both from your computer but the webserver can't see outside the root directory. Like dgraphx said
0
 
LVL 29

Expert Comment

by:Pravin Asar
ID: 39268047
For any particular reason, if you have to keep out of the web root folder, you can always define the virtual directory mapping.

You can do the virtual directory mapping, with webserver config.
The mechanics of virtual directory mapping will depend on the platform (windows/linux) and web server (IIS/apache)

You can also do this with Coldfusion.

Look at the post by Ray and Ben

http://www.raymondcamden.com/index.cfm/2009/8/2/ColdFusion-9-Virtual-File-System-for-your-Application

http://www.bennadel.com/blog/1651-Learning-ColdFusion-9-Virtual-File-System-vs-Actual-File-System.htm
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

726 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