连接超时使用Zehon FTP断开连接

时间:2015-09-26 21:49:56

标签: coldfusion ftp

我在ColdFusion 9服务器上使用Zehon FTP实用程序。当我是FTP文件时,它会创建一个目录,传输大约16个文件,然后给出消息:

com.zehon.exception.FileTransferException: org.apache.commons.vfs.FileSystemException: Could not connect to FTP server on "ftpservername.com".

以下是代码:

    <cfscript>
//FTP server information
host = "#getSiteList.TMS_FTPADDRESS#";
username = "#getSiteList.TMS_USERNAME#";
password = "#getSiteList.TMS_PASSWORD#";


/* sendingFolder = Folder whose content is to be uploaded recursively
*  to the FTP server.
*/
sendingFolder = "#local_Folder#";

/* Forward slash / = root dir of FTP server.
*  if you wish to FTP to privateDir under the root, for example,
*  then set destFolder to "/privateDir"
*/
destFolder = "/#parent_Folder#";
FTP = createObject("java", "com.zehon.ftp.FTP");
thisBatchTransferProgressDefault= createObject("java", "com.zehon.BatchTransferProgressDefault").init();
FileTransferStatus = createObject("java", "com.zehon.FileTransferStatus");
try {
   status = FTP.sendFolder(sendingFolder, destFolder, thisBatchTransferProgressDefault, host, username, password);
    if(FileTransferStatus.SUCCESS is status){
        writeOutput(sendingFolder & " got ftp-ed successfully to folder " & destFolder);
    }
    else if(FileTransferStatus.FAILURE is status){
        writeOutput("Failed to ftp to folder " & destFolder);
    }
} catch (any e) {
   writeOutput(e.message);
}   
</cfscript>

我在两个不同的服务器上尝试过这个问题。如果我使用FileZilla或CFFTP,我可以传输我的所有文件(CFFTP在创建子文件夹时遇到问题,这就是为什么我离开它,我们希望我们的客户将他们的Web应用程序用于FTP文件,而不是客户端)。有没有人经历过这个?如果是这样,是否发现了解决方案?感谢

0 个答案:

没有答案