curl / Mailing Lists / curl-users / Single Mail

curl-users

Re: Upload multiple files from a set directory

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 1 Apr 2017 00:13:27 +0200 (CEST)

On Fri, 31 Mar 2017, Nikos Andritsakis wrote:

> curl -s --ftp-create-dirs -T C:\iRallyMaster\Textfiles\Website\Omnis7\*.* -u
> FTPUSER:FTPPASS
> ftp://ftp.omae-epa-live.gr/www.omae-epa-live.gr/web/content/RALLY4/

curl doesn't support wildcards like that so you need to be slightly more
creative.

For example write a script that generates the full command line to use as a
file and then pass that file to "curl -K file".

If it had been a unix, you could've done it similar to:

   ls | awk '{ print "-T ftp://ftp.example.com/ " $1; }' > uploadcmd
   curl -K uploadcmd
   rm uploadcmd

Or if you'd be fancy, just pipe it instead of creating a temp file:

   ls | awk '{ print "-T ftp://ftp.example.com/ " $1; }' | curl -K -

As you seem to use Windows, you need to adapt this slightly for your local
conditions but the same concepts still apply.

-- 
  / daniel.haxx.se
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2017-04-01