Solved

cfinclude with relative path driving me nuts!!

Posted on 2013-06-12
3
373 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 42

Expert Comment

by:Rob Jurd, EE MVE
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 28

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

867 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

21 Experts available now in Live!

Get 1:1 Help Now