I do this in my Application.cfm:

<!--- use Switch/Case to set variables based on server where app is running
--->    
<cfswitch expression="#CGI.SERVER_NAME#">
        
        
        <!--- This is the siteurl stuff for the load test box --->
        <cfcase value="www.workingserver.com">
        <cfscript>
                //set DSN variable
                        request.GLDSN='mydsn';

                        request.siteurl='http://www.workingserver.com/';
        
request.securesiteurl='https://www.workingserver.com/';
                        request.pictureupload='\\unc\path';
                        request.filewrite='\\unc\path';
                
                //mapping, below, is generally a cold fusion mapping set up
in the administrator
                        request.cfmapping='/mymapping/';
        </cfscript>
                        </cfcase>
        
Then just create a case statement for each of the server environments.

The only problem I see is if both you and the other developer are using
"localhost" ... but then you don't need to send each other the
Application.cfm file every time, do you?

H.

        
        

> -----Original Message-----
> From: Smith, Matthew P -CONT(DYN) [SMTP:[EMAIL PROTECTED]
> Sent: Friday, February 21, 2003 11:57 AM
> To:   CF-Talk
> Subject:      RE: easy path question
> 
> Unfortunately, I'm helping out with a site that another developer at a
> remote site wrote.  We are bouncing files back and forth.  I have some
> stuff
> dependent on paths and wanted to make it portable so differences on the
> site's root wouldn't affect functionality.  A mapping is about the same as
> hard coding it.
> 
> Thanks though.
> 
> Matthew P. Smith 
> Web Developer, Object Oriented 
> Naval Education & Training Professional 
> Development & Technology Center 
> (NETPDTC) 
> (850)452-1001 ext. 1245 
> [EMAIL PROTECTED] 
> 
> 
> -----Original Message-----
> From: Owens, Howard [mailto:[EMAIL PROTECTED] 
> Sent: Friday, February 21, 2003 1:35 PM
> To: CF-Talk
> Subject: RE: easy path question
> 
> Have you looked at mappings in the administrator?
> 
> Here's what I do ...
> 
> Setting a mapping in the administrator
> 
> Then set this in the Application.cfm
> 
> request.cfmapping="/mymapping/"
> 
> Then in my code:
> 
> <cfinclude template="#request.cfmapping#">
> 
> hth
> 
> 
> H.
> 
> 
> > -----Original Message-----
> > From:       Smith, Matthew P -CONT(DYN)
> [SMTP:[EMAIL PROTECTED]
> > Sent:       Friday, February 21, 2003 11:33 AM
> > To: CF-Talk
> > Subject:    easy path question
> > 
> > I'd like to have an expression in Application.cfm that tells me the path
> > to
> > the current site, basically the web path to the directory Appication.cfm
> > is
> > in.
> >  
> > So if we are in c:\interpub\wwwroot\subSite\Application.cfm
> >  
> > And I call
> >  
> > http://myserver.com/subSite/subdirectory/subsubDirectory/page.cfm
> > <http://myserver.com/subSite/subdirectory/subsubDirectory/page.cfm> 
> >  
> > I would have a var available in Application.cfm that resolves to:
> >  
> > /subSite/
> >  
> > Hmm, seemed simple but I'm not explaining it well...  Basically the web
> > path
> > to Application.cfm, so I can set it to a var and append it like:
> >  
> > #sitePath#subdirectory/subsubDirectory/page.cfm
> >  
> > As the site may be moved to different directories.
> >  
> > I know it's doable but mixing all the getBaseTemplateScriptNamePath
> > functions gets tricky for me.
> >  
> > Thanks!
> >  
> > Matthew P. Smith 
> > Web Developer, Object Oriented 
> > Naval Education & Training Professional 
> > Development & Technology Center 
> > (NETPDTC) 
> > (850)452-1001 ext. 1245 
> > [EMAIL PROTECTED] 
> >  
> > 
> > 
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
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

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to