Link to home
Start Free TrialLog in
Avatar of Westside2004
Westside2004Flag for United States of America

asked on

Mapping Question, getting some error with a <cfset>

Hi,

I am trying to use the following code, but seem to get an error with this line:

<cfset href = /Mapped_Dir/&#GetFileFromPath(Key)#>      

Error:  Invalid CFML construct found on line 52 at column 47.  
ColdFusion was looking at the following text:
/

 
I tried to setup a mapping ColdFusion (not sure if I was supposed to or not, but thought I should).  The mapping looked like this in CFadmin

Logical Path: /Mapped_Dir
Directory Path: X:\files

The code block is below:

<CFOUTPUT query="GetResults">
                  
      <cfset dbfilename = #GetFileFromPath(Key)#>
      <cfset href = /Mapped_Dir/&#GetFileFromPath(Key)#>      
            
      <tr>
                      <td class="intro">
<a class="blah" href="##" onclick="javascript: window.open       ('#href#','','toolbar=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,location=yes,width=800,height=600'); return false;">
        #dbfilename#
</a>                              
            </TD>
      </tr>            
                  
</CFOUTPUT>      

It seems some of the slashes in the <cfset> tag shown above are creating the problem.

Anyone have any thoughts?

Thanks

-WestSide
Avatar of Westside2004
Westside2004
Flag of United States of America image

ASKER

Hi..

Answered my own question...

I need quotes in the <cfset> tag

<cfset href = "/Mapped_Dir/&#GetFileFromPath(Key)#">

Thanks...  Please delete or close this question out if possible..
yeah ... also JFYI : u cld also write it as

<cfset href = "/Mapped_Dir/#GetFileFromPath(Key)#">
[u dont need to use "&" there]

K'Rgds
Anand
Avatar of mrichmon
mrichmon

Please post here lettig them know you solved your own question :

https://www.experts-exchange.com/Community_Support/

Include a link to this question.
ASKER CERTIFIED SOLUTION
Avatar of WesLennon
WesLennon
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial