Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Sending multiple files through FTPClient


Christopher Oct 8, 2009 09:09 PM

Is it possible to configure the FTPClient command to send more than one file at a time? In other words, can I give it an array of file names to transmit? If so, how would I structure said command?

Thanks,
Chris


Dana Oct 8, 2009 11:51 PM

In doing some testing, it does not look like the FTPClient supports multiple files, but I will double-check with the developers to make sure there's not a command of which I am unaware.

Regards,

Dana


Dana Oct 9, 2009 04:18 PM

I double-checked and the FTPClient cannot send multiple files, though this is something we can consider for future OS versions.

The developer did suggest processing the files using a loop:

dim i
dim Files(3) as String * 64 =
{"USR:File1.dat","USR:File2.dat","USR:File3.dat"}

for i = 1 to 3
FTPClient(...,Files(i) )
next i

The syntax I highlighted above is fairly new (implemented in the most recent OSes); i.e., the ability to initialize a variable when declared. If your file name is dynamic, then you would use some other technique to populate the Files() array.

Regards,

Dana


Dana Oct 9, 2009 04:20 PM

dim Files(3) as String * 64 = {"USR:File1.dat","USR:File2.dat","USR:File3.dat"}


Note that this needs to be all on one line. Word-wrap caused the initialization strings to move to the next line.

:) Dana


Christopher Oct 9, 2009 04:31 PM

Dana,

Thanks for the reply! We are already using a loop to send the files. The problem we have run into is the time per file (20-30 seconds). It appears to be an issue with the handshaking that occurs per file transfer rather than the size of the file since files sizes vary by as much as 100x, while connection times vary by only 1x.

So if we can't send multiple files per connection, are there other settings available to us to fine tune the FTPClient connection handshaking?

Chris


Dana Oct 9, 2009 04:39 PM

The only advice I can offer is to run the FTPClient in a SlowSequence, so it is not holding up the main program execution.

Regards, Dana


Christopher Oct 9, 2009 04:54 PM

Ahhhh. Reverse DNS lookups timing out can cause all kinds of problems :>. We are down to 22 seconds to transfer 16 files that were taking close to 5.5 minutes. Life is better. Consider this thread closed and thanks!

Log in or register to post/reply in the forum.