Skip to main content
Participant
April 19, 2006
Answered

Folder name from cfdirectory in CF5

  • April 19, 2006
  • 2 replies
  • 291 views
I can retrieve the folder path for the directory attribute of <cfdirectory> using GetDirectoryFromPath. In newer versions GetDirectoryFromPath has the directory attribute but that is not available in CF5. What would be an easy way to extract just the folder name in CF5? I have a script that is accessed by different sections of the site and I want to be able to send people back to the area they came from initially.
    This topic is closed to new replies. Start a new post to keep the conversation going.
    Correct answer The_ScareCrow
    You can use GetDirectoryFromPath in cf5
    Then use listlast to get the directory name.

    ListLast(GetDirectoryFromPath(thisPath), "\")

    Ken

    2 replies

    The_ScareCrowCorrect answer
    Inspiring
    April 20, 2006
    You can use GetDirectoryFromPath in cf5
    Then use listlast to get the directory name.

    ListLast(GetDirectoryFromPath(thisPath), "\")

    Ken
    Participant
    April 20, 2006
    ListLast is exactly what I needed, I don't need <cfdirectory> at all.

    #ListLast(GetDirectoryFromPath(GetBaseTemplatePath()),"\")#

    Thanks