Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Faster FTP download & delete

Status
Not open for further replies.

lorenzodv

Programmer
Feb 16, 2001
95
IT
Hi.

I'm making a program with VB6: I need to download a large number of files from FTP (arround 1000), each 108 bytes long.
For this purpose, I used the Internet Transfer Control.
I'm doing it in the following way:

1. Connect to FTP server
2. LS command to get name of files
3. GET command for each file returned by LS (For loop)
4. DELETE command for each file (For loop)
5. Quit FTP

The problem is that the process is TOO SLOW! It tooks AGES to download very small files. It looks like it spends more time sending and receiving commands than downloading files. Is there a way to faster the download? Maybe, may I type something like "GET *.*" and "DELETE *.*"? Is the ITC the only solution, or is there any other control/API I can use?

Thanks very much for your help.

--
Lorenzo
 
I don't know what platform the files are located on, but would be possible to ZIP them up into one big file and then download the one file. You could use the -m command to move the files to the ZIP file and that would take care of deleting them for you.

There are freeware ZIP libraries out there that you can integrate with VB that work great. Snaggs
tribesaddict@swbell.net
2 wire mesh butchering gloves:
1 5-finger, 1 3-finger, pair: $15
 
Zipping the files wouldn't work anyway unless you were physcially on the server. Otherwise, the files would have to be transferred accross one by one in order to be zipped up by the client PC. You could try the FTP command MGET *.* (MGET = Multiple Get) and then MDELETE (MDELETE = multiple delete).
Also, if you don't want to use the INET control, then take a look at the actual APIs exported from WININET.DLL. I wrote an application once that performed automatic LOGIN and FTP downloads based on a timer using direct APIs out of this DLL.

- Jeff Marler
 
jmaler,

As far as zipping files on the remote site... there are several things I can think of to do that.

1. You could have a process that runs on the server that monitors the directory that does the process of zipping the files. Then when the client logs in, all they would have to do is download the zip file.

2. You could have a nightly maintenence job run like a CRON job or something like that to create the zip file.

3. You could use RPC (Remote Procedure Call) technology to invoke the zip program on the remote machine.

4. You could create a custom server side application, that would accept a conenction on a socket. Once conencted, you could initiate the zip process on demand among other things. Snaggs
tribesaddict@swbell.net
To define recursion, we must first define recursion.
 
Jeff,

My applogies for spelling your name wrong, I meant to type Marler. Too much BattleBots I guess (Mauler). :) Snaggs
tribesaddict@swbell.net
To define recursion, we must first define recursion.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top