问题描述:

I am using the ColdFusion script below to copy images from an ftp server. I am not sure if there is another/better way to do this. As it takes long to transfer the images.

<cfftp connection = "myConnection"

username = "#username#"

password = "#password#"

server = "#server#"

action = "open"

timeout = "500"

stopOnError = "Yes">

<cfloop index="i" from="1" to="#ArrayLen(ImagesArray)#">

<cfset slocal = "temp\" & ImagesArray[i] >

<cfset sremoteFile = "Images\" & ImagesArray[i]>

<cftry>

<cfftp

connection = "myConnection"

action = "getFile"

name = "uploadFile"

transferMode = "binary"

failIfExists = "false"

localFile = "#slocal#"

remoteFile = "#sremoteFile#" />

<cfcatch>

<cfabort>

</cfcatch>

</cftry>

<cfset files = files & "|" & slocalFile>

<cfset fileliste = fileliste & arFiles[i] & "|">

</cfloop>

<cfftp connection = "myConnection"

action = "close"

stopOnError = "Yes">

相关阅读:
Top