Re: Expandpath() is returning the wrong path.
On Thursday, Sep 18, 2003, at 12:23 US/Pacific, Ian Skinner wrote: Is not #expandpath(/)# supposed to return the absolute directory of the webroot that the template is in? It will return the ColdFusion document root, not the IIS document root. For many people, those are the same but for many others, those are not. ColdFusion doesn't know about the IIS document root, only its own. For example, our (Apache) web server document root is: /data/www/sites/www.macromedia.com/docs/ But out ColdFusion document root is: /data/www/appserver/cfmx/wwwroot/ And, in most cases for us, these are on different servers. I have used constructs such as this many times since CF4.5 days. And if your CF and IIS document roots both point to the same directory then expandPath(/) will give you the IIS document root (because that's the same as the CF document root). it returned the absolute path of the CF stand-alone web server webroot (c:/cfusionMX) by default I believe. A directory that the template was not in, or any templates for that matter. So CF must still have had some configuration to say that / was mapped to that directory. I also remember, finding a technote the discussed this, and modifying an XML file to correct the behavior. Basically something about the default order of searches when multiple web roots exits, or something along those lines. Yup, sounds likely. I thought disabling the stand-alone server would solve this problem, but it has not. Correct, because the mapping still exists to c:\cfusionmx\ and that was taking precedence over the mapping you needed. Sounds like you fixed it by adding a new virtual-mapping? That probably changed the search order for multiple web roots... Sean A Corfield -- http://www.corfield.org/blog/ If you're not annoying somebody, you're not really alive. -- Margaret Atwood ~| Message: http://www.houseoffusion.com/lists.cfm?link=i:4:137701 Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. http://www.cfhosting.com
Re: Expandpath() is returning the wrong path.
On Thursday, Sep 18, 2003, at 11:40 US/Pacific, Ian Skinner wrote: I have an expandpath(/) and it is returning the path of the ColdFusion standalone web server web-root (c:/cfusionmx/wwwroot) rather then the correct web root of the IIS website (d:/websites/bloodsource). But expandPath() only knows about the ColdFusion root - it can't possibly know about the web server root. Sean A Corfield -- http://www.corfield.org/blog/ If you're not annoying somebody, you're not really alive. -- Margaret Atwood ~| Message: http://www.houseoffusion.com/lists.cfm?link=i:4:137568 Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. http://www.cfhosting.com
RE: Expandpath() is returning the wrong path.
Have you tried setting a mapping in the CF Admin that maps '/' to 'd:/websites/bloodsource'? I bet that'll solve the problem. barneyb -Original Message- From: Ian Skinner [mailto:[EMAIL PROTECTED] Sent: Thursday, September 18, 2003 11:41 AM To: CF-Talk Subject: Expandpath() is returning the wrong path. Let's try this in the correct forum. I have an expandpath(/) and it is returning the path of the ColdFusion standalone web server web-root (c:/cfusionmx/wwwroot) rather then the correct web root of the IIS website (d:/websites/bloodsource). I remember solving this recently on a different box, but I can't remember which XML file I tweaked, or the Macromedia Technote that told me what to do. Anybody know what I am talking about and can you fill in the holes in my memory. Thanks. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA ~| Message: http://www.houseoffusion.com/lists.cfm?link=i:4:137567 Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
RE: Expandpath() is returning the wrong path.
We have a mapping set as you suggested, it does not solve the problem as the problem is unrelated to mappings. I am trying to find the absolute path of the webroot (/) of a template by using #expandpath(/)# as shown in the documentation for expandpath. Not using a server mapping as one might use in a cfinclude template=/foobar.cfm tag. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA -Original Message- From: Barney Boisvert [mailto:[EMAIL PROTECTED] Sent: Thursday, September 18, 2003 12:00 PM To: CF-Talk Subject: RE: Expandpath() is returning the wrong path. Have you tried setting a mapping in the CF Admin that maps '/' to 'd:/websites/bloodsource'? I bet that'll solve the problem. barneyb -Original Message- From: Ian Skinner [mailto:[EMAIL PROTECTED] Sent: Thursday, September 18, 2003 11:41 AM To: CF-Talk Subject: Expandpath() is returning the wrong path. Let's try this in the correct forum. I have an expandpath(/) and it is returning the path of the ColdFusion standalone web server web-root (c:/cfusionmx/wwwroot) rather then the correct web root of the IIS website (d:/websites/bloodsource). I remember solving this recently on a different box, but I can't remember which XML file I tweaked, or the Macromedia Technote that told me what to do. Anybody know what I am talking about and can you fill in the holes in my memory. Thanks. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA ~| Message: http://www.houseoffusion.com/lists.cfm?link=i:4:137572 Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. http://www.cfhosting.com
RE: Expandpath() is returning the wrong path.
??? You lost me? Is not #expandpath(/)# supposed to return the absolute directory of the webroot that the template is in? For example, if the webroot of a website is defined in IIS to be e:/intranet and a file located at e:/intranet/includes/common/header.cfm runs the function #expandpath(/)#, the value returned should be E:/intranet. Then you should be able to use this value in tags and functions that require an absolute path such as cffile. I have used constructs such as this many times since CF4.5 days. But, on one MX box it caused me a problem because the function wasn't returning the absolute path of the webroot for the website the template was in, (e:/intranet) in my example, rather it returned the absolute path of the CF stand-alone web server webroot (c:/cfusionMX) by default I believe. A directory that the template was not in, or any templates for that matter. I also remember, finding a technote the discussed this, and modifying an XML file to correct the behavior. Basically something about the default order of searches when multiple web roots exits, or something along those lines. I thought disabling the stand-alone server would solve this problem, but it has not. I just can't remember either the technote nor the XML file, and I not finding in searches of the TechNotes. I was hoping somebody could fill-in the gaps in my memory. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA -Original Message- From: Sean A Corfield [mailto:[EMAIL PROTECTED] Sent: Thursday, September 18, 2003 11:59 AM To: CF-Talk Subject: Re: Expandpath() is returning the wrong path. On Thursday, Sep 18, 2003, at 11:40 US/Pacific, Ian Skinner wrote: I have an expandpath(/) and it is returning the path of the ColdFusion standalone web server web-root (c:/cfusionmx/wwwroot) rather then the correct web root of the IIS website (d:/websites/bloodsource). But expandPath() only knows about the ColdFusion root - it can't possibly know about the web server root. Sean A Corfield -- http://www.corfield.org/blog/ If you're not annoying somebody, you're not really alive. -- Margaret Atwood ~| Message: http://www.houseoffusion.com/lists.cfm?link=i:4:137577 Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
RE: Expandpath() is returning the wrong path (SOLVED)
I found the XML file that I was looking for. Now, it would be nice to know what I was really doing here. By adding a second virtual-mapping to the enclosed file, the expandpath() function is now correctly returning D:\inetpub\websites\bloodsource instead of C:\cfusionMX\. But what is it that I have really done? C:\CFusionMX\wwwroot\WEB-INF\jrun-web.xml ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE jrun-web-app PUBLIC -//Macromedia, Inc.//DTD jrun-web 1.0//EN http://www.macromedia.com/dtd/jrun-web.dtd; !-- = -- !-- This XML file contains web application elements that are -- !-- specific to the JRun Application Server -- !-- = -- jrun-web-app !-- === -- !-- Virtual path mappings allow a resource path to be mapped-- !-- to a different physical location (i.e. not necessarily -- !-- within the web application root). A resource-path can -- !-- end with a wild card '*' indicating that all resources -- !-- paths that start with the given path will be resolved using -- !-- the system path.-- !-- === -- virtual-mapping resource-path/WEB-INF/resource-path system-pathC:/CFusionMX/wwwroot/WEB-INF/system-path /virtual-mapping !-- New Mapping added that resloves problems with expandpath() -- virtual-mapping resource-path/*/resource-path system-pathD:/inetpub/websites/bloodsource/system-path /virtual-mapping /jrun-web-app -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA ~| Message: http://www.houseoffusion.com/lists.cfm?link=i:4:137602 Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Get the mailserver that powers this list at http://www.coolfusion.com