September 12th, 2003, 01:34 PM
-
ListLast()
Hello,
I know I can use
currentscript=ListLast(cgi.script_name,"/");
to get the name of a file -- the last entry after the "/" in the path to the file, culled from the web address.
But, I really want to get the name of the *directory* that the file is in. Is there a function called something like
ListSecondToLast() ???
Thanks all,
Laura S.
September 14th, 2003, 07:41 PM
-
This should do it:
<cfoutput>
#listGetAt( cgi.script_name, ( listLen( cgi.script_name, '/' ) - 1 ), '/' )#
</cfoutput>
September 16th, 2003, 08:22 AM
-
Thanks ... I also figured out that
ListFirst(cgi.script_name,"/");
will also work to get me the directory name I want, if the path to the file is only one level deep.
Cheers,
Laura S.