Matt Levine
01/15/2025, 1:47 AM/myMappedDir=/var/www/myMappedDir.
But expandPath('/myMappedDir') returns /var/www/myMappedDir/app/var/www/myMappedDir
It doesn't always happen, but once it starts happening I can't get it to stop until it seems to randomly fix itself?
This is the mapping in the lucee-server.xml
<mapping inspect-template="" physical="/var/www/myMappedDir" primary="physical" readonly="false" toplevel="true" virtual="/myMappedDir"/>
Seem related to the mapping being a parent directory to the app root and it's a part of a docker compose mount,Erin Brewer
01/15/2025, 2:00 AMMatt Levine
01/15/2025, 2:02 AMErin Brewer
01/15/2025, 2:10 AMTomy Saman (Wu)
01/15/2025, 2:11 AMexpandPath('/myMappedDir') , it actually expands /var/www/myMappedDir , that is, treating /var/www/myMappedDir a relative path from your web app root, hence giving you /var/www/myMappedDir/app/var/www/myMappedDir
If you need the location (absolute file path) of /var/www/myMappedDir , you just use /myMappedDir
e.g. result = fileUpload( "/myMappedDir", "fileField" );
It will upload file to /var/www/myMappedDirTomy Saman (Wu)
01/15/2025, 2:13 AM/var/www/myMappedDir is actually an absolute path already even though it may looks like a relative pathMatt Levine
01/15/2025, 2:14 AM/mappedDir and it's pointed at /var/www/mappedDirMatt Levine
01/15/2025, 2:15 AMMatt Levine
01/15/2025, 2:16 AMexpandPath('/mappedDir') I expect to get /var/www/mappedDirMatt Levine
01/15/2025, 2:17 AMMatt Levine
01/15/2025, 2:18 AMMatt Levine
01/15/2025, 2:19 AMTomy Saman (Wu)
01/15/2025, 2:21 AM/var/www/ is your web app root
expandPath('/mappedDir') will give you /var/www/mappedDir if you do NOT have a mapping of /mappedDir => /var/www/mappedDir
But if you do have a mapping /mappedDir => /var/www/mappedDir , expandPath('/mappedDir') is actually running expandPath('/var/www/mappedDir') so it gives you /var/www/var/www/mappedDirErin Brewer
01/15/2025, 2:23 AMMatt Levine
01/15/2025, 2:23 AM/var/www/ is not the webroot, but you are correct, it it was I wouldn;t need the mappingMatt Levine
01/15/2025, 2:24 AMErin Brewer
01/15/2025, 2:25 AMTomy Saman (Wu)
01/15/2025, 2:25 AMexpandPath on a normal path vs on a mapping pathMatt Levine
01/15/2025, 2:26 AMMatt Levine
01/15/2025, 2:27 AMMatt Levine
01/15/2025, 2:37 AM