Copy link to clipboard
Copied
Hi,
First, the code :
LOCAL.fileName = lsDateFormat(now(), 'yyyymmdd') & '.csv';
LOCAL.filePath = "example_file";
LOCAL.ftpService = new FTP();
LOCAL.ftpService.setServer('sftpr.emv2.com');
LOCAL.ftpService.setPort('22');
LOCAL.ftpService.setUserName('example_user');
LOCAL.ftpService.setSecure('true');
LOCAL.ftpService.setKey(example_key.ppk");
LOCAL.ftpService.setStopOnError(true);
LOCAL.ftpService.setRemoteFile('example_remote_file');
LOCAL.ret = LOCAL.ftpService.open();
writeDump(LOCAL.ret);
LOCAL.doInsert = 0;
if(LOCAL.ret.getPrefix().succeeded){
LOCAL.testExists = LOCAL.ftpService.existsFile();
writeDump(LOCAL.testExists);
if(LOCAL.testExists.getPrefix().returnValue){
LOCAL.doInsert = 1;
LOCAL.ftpService.setLocalFile(LOCAL.filePath);
LOCAL.ftpService.setFailIfExists(false);
LOCAL.resp = LOCAL.ftpService.getFile();
writeDump(LOCAL.resp); abort;
}
}
LOCAL.ftpService.close();
Open Connection : OK
Test file exists : OK
getFile : KO
I fire this message every time :
Attribute validation error for tag CFFTP.It has an invalid attribute combination: action,failifexists,key,localfile,port,remotefile,server,stoponerror,username. Possible combinations are:<li>Required attributes: 'action,localfile,password,remotefile,server,username'. Optional attributes: 'agentname,asciiextensionlist,attributes,buffersize,failifexists,fingerprint,passive,port,proxybypass,proxyserver,result,retrycount,secure,stoponerror,timeout,transfermode'. <li>Required attributes: 'action,localfile,key,remotefile,server,username'. Optional attributes: 'agentname,asciiextensionlist,attributes,buffersize,failifexists,fingerprint,passphrase,port,proxybypass,proxyserver,result,retrycount,secure,stoponerror,timeout,transfermode'. <li>Required attributes: 'action,connection,localfile,remotefile'. Optional attributes: 'agentname,asciiextensionlist,attributes,buffersize,failifexists,fingerprint,passive,password,port,proxybypass,proxyserver,result,retrycount,secure,server,stoponerror,timeout,transfermode,username'.
I turn around to this problem since this morning without finding any valid track. Anyone have an idea?
Thanks you
Copy link to clipboard
Copied
You've set the username. Set the password as well.
Copy link to clipboard
Copied
In this SFTP there is no password. just a user and a private key. And in this configuration, if we refer to the doc, my params are good. I can connect to the sftp and I can check if the file exists. So the issue cannot be a password problem.
Copy link to clipboard
Copied
I understand. OK, use password="", and let's see what happens.
Copy link to clipboard
Copied
You may also have to include the attributes, passphrase and fingerprint, according to the cfftp documentation.
Copy link to clipboard
Copied
I tried to set password as an empty string and same thing with passphrase. No change.
I have to specify that my CF server is CF 9.0.1 version. Thx for help anyway. This issue seems not have a simply solution : so I think I will try to get the file by an another way (may be a cfexecute with a ftp software ...)
Copy link to clipboard
Copied
Hang on. Your code says
LOCAL.ftpService.setKey(example_key.ppk");
whereas the documentation says that that must be "the absolute path to the private key of the user".
Furthermore, you say,
I tried to set password as an empty string and same thing with passphrase.
whereas the documentation says that "Because private keys are stored in an encrypted form on the client host, the user must supply a passphrase to enable generating the signature.".
Copy link to clipboard
Copied
It could be ... if I didn't connected yet and checked the file exists. I don't believe, if it was a key issue, I would be able to do that. The passphrase is an optional setting as password if you set a key to the ftp object.
It would seem that the problem is related to CF 9 and it is impossible to do this in a simple manipulation in this context.
Copy link to clipboard
Copied
Having the same exact issue. I submitted a bug to Adobe : Bug#4032599 - Cannot putFile or getFile when using key instead of password within FTP service