Curl - Upload file using the -T or --upload-file option

by
Jeremy Canfield |
Updated: June 24 2022
| Curl articles
The -T or --upload-file option can be used to upload a file to a target server. In this example, foo.txt is uploaded to the /tmp directory on the server with hostname example.com.
curl --upload-file /path/to/foo.txt sftp://example.com/tmp/foo.txt
Did you find this article helpful?
If so, consider buying me a coffee over at