Specify file name with curl –upload-file

command linecurlfilenamesrename

When uploading a file with curl's --upload-file option, how do I specify a file name different than the one on disk? With the -F option, it can be done like this, I think: curl -F 'file=@/path/to/file/badname;filename=goodname', but I'm not sure how to do the equivalent with --upload-file (also -T). I am using an API which requires an uploaded file to have a certain filename, but I don't want to copy the file on-disk just so I can upload it properly.

Best Answer

curl -v --user 'username:password' --upload-file {path}/{binaire} {your_url}/{binaire}

Related Question