cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: multiple upload syntax?

From: Roth, Kevin P. <KPRoth_at_MAPLLC.com>
Date: Wed, 20 Aug 2003 09:08:29 -0400

-----Original Message-----
From: Daniel Stenberg
Sent: Tuesday, August 19, 2003 5:40 PM

>I don't think we can support version A at the same time we support B/C.

Are you sure? All it would take it to be aware of what order the options
appeared on the command line. In other words, if there's only one URL
specified, all -T's go to it. If there are multiple, then all -T's coming
before each url will go to it. Any -T's coming after the last one could
be also sent to the last one on the command line.

I believe there are other commands in curl that are "aware" of the order
of things on the command-line (I was thinking -o was like this, but I could
be wrong...)

>> 1. curl -O http://some.url/some.file http://some.url/some.other.file
>> -> Uses the remote site's filename in the Current-Working-Directory (CWD).

>Not quite. We require one specific output option for each given download URL,
>or it goes to stdout. So this command line would download the first file with
>-O, and the second file would be sent to stdout. You would need two -O (or -o)
>options to get both saved to local files.

Perhaps you could consider "fixing" this? I would think a "-O" should apply
to all URLs in the line (especially in the absence of any other -o/-O type
arguments). The user could still use "-o -" to force the second download to
go to stdout again.

Of course, since it's already implemented, it's probably too late to change...

>We should also remember to support mixed uploads and downloads, by offering a
>-T version that switches off upload. Like -T "" or something. So, to first
>download one file then upload one file in a single command line, it could look
>like this:

> curl -T "" -o file http://file.com -T uploadit -o result http://file.com

This seems kind of complex. If you remove the '-T ""' from above, and
simply read from left-to-right, you'd naturally assume that we wanted
to download http://file.com to a file named 'file', and then upload
'uploadit' to the same url, storing the results into 'result'.

Would it be simpler to require that multiple downloads within the same
command must place all URL-specific arguments either BEFORE or AFTER
a given URL in the line, but not both?

Here's another off-the-wall possibility: could we label the URLs
(like --url:1 http://file.com), and then label any URL-specific
arguments? Here's what that might look like, for your example above:

  curl -o:1 file --url:1 http://file.com
   -T:2 uploadit --output:2 result --url:2 http://file.com

Then, if the ':n' qualifiers are left off, you use today's logic to
attempt to match things up. But if the user specifies qualifiers,
they take precedence.

-- Kevin

-------------------------------------------------------
This SF.net email is sponsored by Dice.com.
Did you know that Dice has over 25,000 tech jobs available today? From
careers in IT to Engineering to Tech Sales, Dice has tech jobs from the
best hiring companies. http://www.dice.com/index.epl?rel_code4
Received on 2003-08-22