cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: Uploading multiple files

From: <uria_at_uriaa.com>
Date: Sun, 26 Jun 2005 16:26:56 -0400

Is that a good idea to open a connection to the FTP server for each file?
Isn't it going to create a problem when working with hundreds of files?

-----Original Message-----
From: curl-users-bounces_at_cool.haxx.se
[mailto:curl-users-bounces_at_cool.haxx.se]On Behalf Of Bill Mercer
Sent: Sunday, June 26, 2005 3:49 PM
To: curl-users_at_cool.haxx.se
Subject: RE: Uploading multiple files

>The issue is that I have a large and dynamic list of files is my local
directory.
>I can't possibly create a single command for all of them.

You don't have to, you let the computer do it for you. This is why the
FOR command
ws created.

Go to a dos prompt, and type HELP FOR to see all the options you can
use with the FOR command.

Here's a simple example of a batch file that will upload all files in a
folder with the extention .dat to an FTP server.

CD C:\data
for %%f in (*.dat) do @curl -T %%f ftp://your.ftp.server/%%f

Cheers,

Bill Mercer - National Center for Construction Education and Research
3600 NW 43rd St
Gainesville, Florida 32606
http://www.nccer.org
Phone 352-334-0911 Fax 352-334-0932
=============================================
Received on 2005-06-26