curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. 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 himself.

Re: --time-cond <file> with --remote-header-name?

From: Daniel Stenberg via curl-users <curl-users_at_lists.haxx.se>
Date: Sat, 27 Apr 2024 16:43:31 +0200 (CEST)

On Sat, 27 Apr 2024, Paul Gilmartin via curl-users wrote:

> I would like to fetch a file with --remote-header-name depending on
> -time-cond <file>
>
> I could use %{filename_effective} to get the filename, but that's available
> only after the transfer, too late for -time-cond <file> to operate.
>
> Is there a way?

It really can't be done. Since curl needs to pass in the time for the
condition already in the initial request, it needs to get that time from
somewhere. Like a local file. You then need to tell it the name of the local
file.

It can't first do a request to get to know the file name, as then it is
already too late to get the time and included it in the request.

You can possibly do a --head request first to figure out the
--remote-header-name file name, and then do a follow-up request and use that
file name for --time-cond.

-- 
  / daniel.haxx.se
  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
  | https://curl.se/support.html
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2024-04-27