Buy commercial curl support. We
help you work out your issues, debug your libcurl applications, use the API,
port to new platforms, add new features and more. With a team lead by the
curl founder Daniel himself.
Re: Reference upload glob pieces in output filename
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Stefan Eissing via curl-users <curl-users_at_lists.haxx.se>
Date: Wed, 22 Apr 2026 09:49:51 +0200
> Am 22.04.2026 um 09:35 schrieb Daniel Stenberg via curl-users <curl-users_at_lists.haxx.se>:
>
> Hi,
>
> It struck me that when using globbing for uploads to a single URL, there is no way to store the three responses in separate output files. Example:
>
> curl -T '{one,two,three}' https://upload.example/ -o save-output
>
> This command line makes curl overwrite the same target file multiple times and afterwards only the last response remains. *sad face*
>
> As a comparison, downloading with globbing in the URL allows us to use pieces of the glob in the output name:
>
> curl 'https://upload.example/{one,two,three}' -o 'save-#1'
>
> I have now made a first PR and attempt to allow us to fix the initial omission by adding a way to refer to upload globs separately for the output filename, using ! instead of #. Like this:
>
> curl -T 'file{1,2,3}' https://upload.example/ -o 'response-!1'
>
> Maybe we can think of a better way?
Have not looked at the internals. As a user, I would expect `-o 'save-#1' to also work for uploads.
(I assume the #1 counter only counts url globs and not upload globs, but that is an implementation detail, or?)
>
> https://github.com/curl/curl/pull/21407
>
> --
>
> / daniel.haxx.se || https://rock-solid.curl.dev
> --
> Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
> Etiquette: https://curl.se/mail/etiquette.html
Date: Wed, 22 Apr 2026 09:49:51 +0200
> Am 22.04.2026 um 09:35 schrieb Daniel Stenberg via curl-users <curl-users_at_lists.haxx.se>:
>
> Hi,
>
> It struck me that when using globbing for uploads to a single URL, there is no way to store the three responses in separate output files. Example:
>
> curl -T '{one,two,three}' https://upload.example/ -o save-output
>
> This command line makes curl overwrite the same target file multiple times and afterwards only the last response remains. *sad face*
>
> As a comparison, downloading with globbing in the URL allows us to use pieces of the glob in the output name:
>
> curl 'https://upload.example/{one,two,three}' -o 'save-#1'
>
> I have now made a first PR and attempt to allow us to fix the initial omission by adding a way to refer to upload globs separately for the output filename, using ! instead of #. Like this:
>
> curl -T 'file{1,2,3}' https://upload.example/ -o 'response-!1'
>
> Maybe we can think of a better way?
Have not looked at the internals. As a user, I would expect `-o 'save-#1' to also work for uploads.
(I assume the #1 counter only counts url globs and not upload globs, but that is an implementation detail, or?)
>
> https://github.com/curl/curl/pull/21407
>
> --
>
> / daniel.haxx.se || https://rock-solid.curl.dev
> --
> Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
> Etiquette: https://curl.se/mail/etiquette.html
-- Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users Etiquette: https://curl.se/mail/etiquette.htmlReceived on 2026-04-22