I am trying to use the secure FTP function ColdFusion. I run the error using a function fileExists
only when using a secure connection. Instead of returning "no" when the file that was transferred does not exist, instead the errors say:
"An error occurred during the sFTP existsFile operation.
The system cannot find the path {file name} "
Error image
A regular FTP file works fine (the same code as below, but with a different connection).
If the file exists, then there is no problem, and the file will be deleted and written.
I feel that this is a mistake, but I confirm that I am not doing something wrong or that something is missing.
<cfftp action="open"
connection="ftp_connection"
server="#this.server#"
port="#this.port#"
username="#this.username#"
password="#this.password#"
fingerprint="#this.fingerprint#"
secure="yes"
/>
<cfftp action="existsFile"
connection="ftp_connection"
remotefile="#arguments.remote_name#"
directory="/"
/>
<cftry>
<cfif cfftp.returnValue EQ "Yes" or cfftp.returnValue EQ "true">
<cfftp action="remove"
connection="ftp_connection"
item="#arguments.remote_name#"
/>
</cfif>
<cfftp action="putFile"
connection="ftp_connection"
passive="true"
localfile="#ExpandPath('/vctemp/#arguments.local_name#')#"
remotefile="#arguments.remote_name#"
/>