Skip to main content
Foums
Participant
April 27, 2015
Question

ftp action:getFile - Attribute validation error

  • April 27, 2015
  • 2 replies
  • 927 views

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

This topic has been closed for replies.

2 replies

Participant
August 6, 2015
BKBK
Community Expert
Community Expert
May 2, 2015

You've set the username. Set the password as well.

Foums
FoumsAuthor
Participant
May 2, 2015

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.

BKBK
Community Expert
Community Expert
May 3, 2015

I understand. OK, use password="", and let's see what happens.