curl / Mailing Lists / curl-users / Single Mail
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.

Reference upload glob pieces in output filename

From: Daniel Stenberg via curl-users <curl-users_at_lists.haxx.se>
Date: Wed, 22 Apr 2026 09:35:29 +0200 (CEST)

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?

   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
Received on 2026-04-22