Solved

cfinclude with relative path driving me nuts!!

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Tags from access to excel 3 38
Why a span is lower 2 19
Expand HTML tables without having to click on it 15 36
ASP server side get value 15 18
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.
This article discusses four methods for overlaying images in a container on a web page
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…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

813 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

18 Experts available now in Live!

Get 1:1 Help Now