Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 162
  • Last Modified:

Default file location

I would like to specify a directory where i can keep common files so that i can reference it from any directory in the application, strictly by name, so instead of <cfinclude template="../../../dir/file.ext"> i can simply do <cfinclude template="dir/feil.ext">
0
James Rodgers
Asked:
James Rodgers
  • 3
  • 2
1 Solution
 
pinaldaveCommented:
jester in that case you need to have mapping of this directory in the application.cfm or coldfusion administrator.
It will do exactly what you need.
Regards,
---Pinal
0
 
James RodgersWeb Applications DeveloperAuthor Commented:
is ther a special tag used in the application.cfm something like <baseTemplate="myDir">
0
 
pinaldaveCommented:
nope... just simple

<cfset application.finebase = 'mydir'>


now you can always use like this....

<cfinclude template="#application.finebase#/myfine.cfm">

you can also map in the CF admin.

Regards,
---Pinal
0
 
James RodgersWeb Applications DeveloperAuthor Commented:
using what you gave me i came up with this

<cfset application.baseTemplate="http://#cgi.server_name##mid(getDirectoryfrompath(CGI.PATH_INFO),1,find('/',CGI.PATH_INFO,2))#templates/">
0
 
James RodgersWeb Applications DeveloperAuthor Commented:
i actually ended up having to map the directory.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now