cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: [Win32] Uploading all files from a directory through FTP?

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Mon, 30 Jul 2007 13:26:09 -0700

On Mon, Jul 30, 2007 at 09:50:03PM +0200, Vincent Delporte wrote:
> I went through the FAQ, online manual, and archives, but haven't found how
> to simply upload all the files from a directory to a remote FTP server.
>
> This doesn't work:
>
> curl -T C:\source\*.c ftp://mylogin:mypass@ftp.acme.com/source/c/
>
> Does someone have some code handy?

This style of file globbing relies on the shell expanding it, and isn't
supported by curl because -T only takes one argument. curl supports {} and
[] globbing only. If that doesn't work for you, you'll need to use a loop
and upload one file at a time, something like this:

for %f in (C:\source\*.c) do curl -T %f ftp://mylogin:mypass@ftp.acme.com/source/c/

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2007-07-30