cURL / Mailing Lists / curl-users / Single Mail

curl-users

wildcards for uploads (was: how to avoid ftp automatic redirects)

From: Seb <spluque_at_gmail.com>
Date: Wed, 10 Oct 2007 16:52:37 -0500

On Wed, 10 Oct 2007 11:43:20 -0700,
Dan Fandrich <dan_at_coneharvesters.com> wrote:

[...]

> If you are specifying an absolute path, you need to add an extra slash
> in front of it: ftp://root.dir//rest/of/path

Thank you, I was just starting to realize that from the curl website.

On a different issue, can one tell curl to upload entire directories?
Say I have a directory:

,-----[ ls -al ~/www/ ]
| total 32
| drwxr-xr-x 5 sluque sluque 4096 2007-10-09 18:20 .
| drwxr-xr-x 11 sluque sluque 4096 2007-10-08 18:23 ..
| drwxr-xr-x 2 sluque sluque 4096 2007-10-09 17:08 include
| -rw-r--r-- 1 sluque sluque 7011 2007-10-09 18:20 index.html
| drwxr-xr-x 2 sluque sluque 4096 2007-10-09 22:40 source
| drwxr-xr-x 2 sluque sluque 4096 2007-10-09 16:14 tracks
`-----

and I'd like to upload the entire 'include' and 'tracks' directories, plus
index.html. Can this be done in a single call to curl with the -T flag?
I instinctively thought:

curl -T ~/www/{include,tracks}/* ftp://upload/path

but the star wildcard is not what I expected from shell expansions.
Thanks for any further input.

-- 
Seb
Received on 2007-10-10