Solved

cfinclude with relative path driving me nuts!!

Posted on 2013-06-12
3
370 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 24

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

705 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

17 Experts available now in Live!

Get 1:1 Help Now