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.

curl changes the PUT path when uploading a file

From: Dirk Rosenkranz via curl-users <curl-users_at_lists.haxx.se>
Date: Fri, 14 Apr 2023 17:56:13 +0000

I use curl to upload files to a webserver (which is not owned by me). I use the following command line:
curl -u <user>:<pw> -T <path to file> https://<server>/uploader/upload/tmp/?file_name=<filename>

This worked till now, e.g. with curl version 7.83.1, which is built in in Windows.
I tried to use the more up to date version 7.88.1 and now 8.0.1 and noticed, that the upload does not work anymore, I get a HTTP code 404.
The --verbose option shows me, that curl changes the upload path in the URL:
...
* h2h3 [:method: PUT]
* h2h3 [:path: /uploader/upload/tmp/<filename>?file_name=<filename>]

This explains the 404, because the resource /uploader/upload/tmp/<filename> does not exist on the server.

The older curl version does not change the upload path, the verbose output shows:
...
> PUT /uploader/upload/tmp/?file_name=<filename> HTTP/1.1

Is there any explanation, why the behavior of curl changed? Or is this a new bug?

Thanks,
  Dirk
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2023-04-14