Attribute validation failed for CFFTP tag. It has an invalid attribute combination

I'm trying to execute getFile

in cfscript on an SFTP server and after working on it all day I'm here hoping to at least get some advice.

So here's my script:

LOCAL.fileName = lsDateFormat(now(), 'yyyymmdd') & '.csv';
LOCAL.filePath = "example_path\#LOCAL.fileName#";

LOCAL.ftpService = new FTP();

LOCAL.ftpService.setServer('sftp.example.com');
LOCAL.ftpService.setPort('22');
LOCAL.ftpService.setUserName('example_user');
LOCAL.ftpService.setSecure('true');
LOCAL.ftpService.setKey("example_privateSSH.ppk");
LOCAL.ftpService.setStopOnError(true);
LOCAL.ftpService.setRemoteFile('example_r_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().succeeded){
        LOCAL.doInsert = 1;
        LOCAL.ftpService.setLocalFile(LOCAL.filePath);
        LOCAL.ftpService.setFailIfExists(false);
        LOCAL.resp = LOCAL.ftpService.getFile();
        writeDump(LOCAL.resp);
    }
}

LOCAL.ftpService.close();

      

Server Connection: OK

ExistsFile test: OK

GetFile: KO.

I receive the following message:

Attribute validation failed for tag CFFTP.It has an invalid combination of attributes: action, failifexists, key, local file, port, remote file, server, stoponerror, username. Possible combinations:

Required attributes: "action, local file, password, remote file, server, username". Additional attributes: "agent name", "asciiextensionlist", "attributes", "buffering", "losers", "fingerprints", "passive", "port", "proxyyce", "proxy server", "result", " retrycount "," safe "," stoponerror "," timeout "," transmission "). Required attributes: "action, local file, key, remote file, server, username". Optional attributes: "agent name", "asciiextensionlist", attributes, buffering, failifexists, fingerprint, passphrase, port, proxybypass, proxyserver, result, retrycount, secure, stoponerror,timeout, transfermode ". Required attributes:" action, connection, local file, remote file. "Additional attributes:" agent name "," asciiextensionlist "," attributes "," buffersize "," failifexists "," fingerprint "," passive "," password "," portxy "," proxybypass "," proxyserver ")," result "," retrycount "," secure "," server "," stoponerror "," timeout "," transmission ").fingerprint "," passive "," password "," portxy "," proxybypass "," proxyserver ")," result "," retrycount "," secure "," server "," stoponerror "," timeout ", "transfer").fingerprint "," passive "," password "," portxy "," proxybypass "," proxyserver ")," result "," retrycount "," secure "," server "," stoponerror "," timeout ", "transfer").

StackTrace

coldfusion.tagext.validation.IllegalAttrConfigException: Attribute validation error for tag CFFTP.
at coldfusion.tagext.validation.TagAttrConfiguration.validate(TagAttrConfiguration.java:212)
at coldfusion.tagext.validation.TagAttrConfiguration.validate(TagAttrConfiguration.java:165)
at coldfusion.tagext.validation.CFMLTagValidator.validateAttrConfiguration(CFMLTagValidator.java:202)
at coldfusion.tagext.GenericTag._setArguments(GenericTag.java:466)
at cfbase2ecfc845959907$funcINVOKETAG.runFunction(C:\ColdFusion9\CustomTags\com\adobe\coldfusion\base.cfc:338)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2582)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2383)
at cfftp2ecfc1567526491$funcINVOKETAG.runFunction(C:\ColdFusion9\CustomTags\com\adobe\coldfusion\ftp.cfc:300)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2582)
at cfftp2ecfc1567526491$funcGETFILE.runFunction(C:\ColdFusion9\CustomTags\com\adobe\coldfusion\ftp.cfc:185)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360)
at cfupdate_stats_nmp2ecfm1620928340.runPage(E:\IIS\wwwroot\softVillage\Scheduled\AdminEmailing\update_stats_nmp.cfm:28)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722)
at cfApplication2ecfc2017417412$funcONREQUEST.runFunction(E:\IIS\wwwroot\softVillage\Application.cfc:56)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337)
at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:88)
at coldfusion.runtime.AppEventInvoker.onRequest(AppEventInvoker.java:280)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:356)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:94)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
at coldfusion.CfmServlet.service(CfmServlet.java:200)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66) 

      

I have checked my code over and over, but cannot find where the invalid code is. Where is my mistake?

+3


source to share


1 answer


Try:



LOCAL.resp = LOCAL.ftpService.getFile('example_r_file',LOCAL.filePath,true);

0


source







All Articles