My code is below. This worked fine on ColdFusion. Once I moved the code over to Lucee, the assigning of the permissions stopped working – and caused an error.
So I can create a new directory, and I can upload a file to that directory just fine. But I can no longer assign file or directory permissions via:
testConn6.sendSiteCommand(“chmod 775 …”)
I’m guessing that Lucee does not use the same FTP client as CF so that “sendSiteCommand” does not exist.
Can anyone recommend a work-around to get this to work? Again, my goal is to:
- Create a directory (if it doesn’t exist)
1-A) Assign “775” permissions to the newly created directory - Upload a file to the newly created directory
- Assign “775” permissions to the file that was uploaded.
I cannot figure out how to assign file/directory permissions (via CFFTP) within Lucee.
<cfftp action = "open"
username = "#application.ftpUserName#"
connection = "testConn6"
password = "#application.ftpPwd#"
server = "#application.ftpServer#"
stopOnError="No"
passive="Yes"
/>
<cfftp connection = "testConn6"
action = "existsDir"
directory="/var/www/html/common_images/ALIVERY/test2"
passive = "Yes">
<cfif #cfftp.returnValue# eq "NO">
<cfftp connection = "testConn6"
action = "createDir"
directory="/var/www/html/common_images/ALIVERY/test2"
passive = "Yes">
<cfscript>testConn6.sendSiteCommand("chmod 775 /var/www/html/common_images/ALIVERY/test2");</cfscript>
</cfif>
<cfftp connection = "testConn6"
action = "PutFile"
localFile="#uploadpath#/#driverimage#"
remoteFile="/var/www/html/common_images/#client.confirmationprefix#/#driverimage#"
failifexists="no"
passive = "Yes">
<cfscript>testConn6.sendSiteCommand("chmod 775 /var/www/html/common_images/#client.confirmationprefix#/#driverimage#");</cfscript>
<cfftp action="close" connection="testConn6" stopOnError="No" passive="Yes" />
Don’t forget to tell us about your stack!
OS: Linux (3.10.0-1160.36.2.el7.x86_64) 64bit
Java Version: 1.8.0_131 (Oracle Corporation) 64bit
Tomcat Version: Apache Tomcat/8.5.14
Lucee Version: Lucee 5.3.9.4-SNAPSHOT