我试图从远程服务器获取一个文件,并得到一个错误:
在FTP getFile操作期间发生错误。
我的密码是:
<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操作运行良好。有人能看出我的代码有什么问题吗?任何帮助都将不胜感激。
发布于 2014-02-12 12:33:46
我找到了解决问题的方法:.zip文件有15 my,默认情况下cfftp超时是30秒。我增加了超时时间,它解决了这个问题。
https://stackoverflow.com/questions/21726242
复制相似问题