List function chaining

I need to store uploaded log files outside the web root. I used the following code successfully to create a path within the web root but can’t chain it further. Is there a variable like “this” that refers to the input string?

#cgi.path_translated.listDeleteAt(cgi.cf_template_path.listLen("\"),"\")#

I would like to do something like this to delete the last 2 elements in the list:

#cgi.path_translated.listDeleteAt(this.listLen("\"),"\").listDeleteAt(this.listLen("\"),"\")#

If you’re just looking to target a relative directory above the web root, try ExpandPath():

privateFolder
- webroot
-- script.cfm

script.cfm

privateFolderPath = ExpandPath( "../privateFolder" );

Elegant. Thank you.