首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >cfftp - FTP getFile操作中的错误

cfftp - FTP getFile操作中的错误
EN

Stack Overflow用户
提问于 2014-02-12 11:10:08
回答 1查看 1.8K关注 0票数 0

我试图从远程服务器获取一个文件,并得到一个错误:

在FTP getFile操作期间发生错误。

我的密码是:

代码语言:javascript
复制
<cfsetting requesttimeout = "3600">

<h1>FTP Connect</h1>
<!--- O P E N --->
<cfftp action = "open"
    server = "#application.server#"
    username="#application.username#"
    password="#application.password#"
    connection = "#application.connection#"
    passive = "#application.passive#">

Did it open connection? <cfoutput>#cfftp.succeeded#</cfoutput><br />


<cfif cfftp.succeeded>

    <cfftp action = "LISTDIR"
        stopOnError = "Yes"
        name = "ListFiles"
        directory = "/www/rentproFeed/"
        connection = "#application.connection#"
        passive = "Yes">

    <cfquery dbtype="query"  name="GetSomeContents">
        SELECT MAX(name) AS latestFeed
        FROM ListFiles
    </cfquery>

    <cfoutput query="GetSomeContents">
        <cfset variables.latestProperties = #latestFeed# >
        #variables.latestProperties#
    </cfoutput>

    <cfftp
        action="getFile"
        connection= "#application.connection#"
        remotefile="/www/rentproFeed/#GetSomeContents.latestFeed#"
        localfile="#expandpath("../properties-feed/")#properties-feed.BLM"
        failIfExists="no">

    Did it downloaded the latest feed file? <cfoutput>#cfftp.succeeded#</cfoutput><br />

    <!--- <cfdump var="#ListFiles#" > --->

    <cfftp action="getFile"
        connection="#application.connection#"
        remoteFile="/www/rentproFeed/01014.zip"
        localFile="#ExpandPath('../properties-feed/latestImages.zip')#"
        failifexists="no"
        <!--- retrycount="10" --->
        >
        <cfoutput>
            FTP Operation Return Value: #cfftp.returnValue# <br/>
            FTP Operation Successful: #cfftp.succeeded# <br/>
            FTFP Operation Error Code: #cfftp.errorCode# <br/>
            FTP Operation Error Message: #cfftp.errorCode#<br/>
            FTP Operation Error Message: #cfftp.errorText# <br/>
        </cfoutput>

</cfif>



<cfftp action="close" connection="#application.connection#" stopOnError="yes">

Did it closed connection? <cfoutput>#cfftp.succeeded#</cfoutput>

<cfabort>

当我想获得"01014.zip“文件时,会发生错误。以前的getFile操作运行良好。有人能看出我的代码有什么问题吗?任何帮助都将不胜感激。

EN

回答 1

Stack Overflow用户

发布于 2014-02-12 12:33:46

我找到了解决问题的方法:.zip文件有15 my,默认情况下cfftp超时是30秒。我增加了超时时间,它解决了这个问题。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21726242

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档