How to upload a file via CLI to Nextcloud? (bash)

I would use cURL like described in the documentation:

curl -u USERNAME:PASSWORD -T /path/to/file https://my.nextcloud.com/remote.php/dav/files/USERNAME/
2 Likes