Image transfer script How can I optimize this?

&lt;cfftp connection = "myConnection" 
   username = "#username#"
   password = "#password#"
   server = "#server#"

   action = "open" 
   timeout = "500"
   stopOnError = "Yes"&gt;                 

&lt;cfloop index="i" from="1" to="#ArrayLen(ImagesArray)#"&gt;    

    &lt;cfset slocal = "temp\" &amp; ImagesArray[i] &gt;
    &lt;cfset sremoteFile = "Images\" &amp; ImagesArray[i]&gt;

    &lt;cftry&gt;             
        &lt;cfftp 
            connection = "myConnection"
            action = "getFile" 
            name = "uploadFile" 
            transferMode = "binary" 
            failIfExists = "false"
            localFile = "#slocal#" 
            remoteFile = "#sremoteFile#" /&gt;
    &lt;cfcatch&gt;
        &lt;cfabort&gt;
    &lt;/cfcatch&gt;
    &lt;/cftry&gt;

    &lt;cfset files = files &amp; "|" &amp; slocalFile&gt;        
    &lt;cfset fileliste = fileliste &amp; arFiles[i] &amp; "|"&gt;    
&lt;/cfloop&gt;   

&lt;cfftp connection = "myConnection"
    action = "close"
    stopOnError = "Yes"&gt;
In my experience, FTP can use up a lot of network packets and CPU time just negotiating the starting and finishing of a single file.  If there exists the option of having an archive uncompressed at the destination, I would suggest zipping the images into a single file for transport.

To get even more performance for the end user making the CF request you could perform the FTP transfer in an asynchronous thread via cfthread.  Launch the thread that zips and sends the file and let the user know that the data is on its way.

Hope this helps, or at least inspires some new ideas.