?
Solved

cfinclude with relative path driving me nuts!!

Posted on 2013-06-12
3
Medium Priority
?
417 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 25

Accepted Solution

by:
dgrafx earned 2000 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

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.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

771 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