Nextcloud cURL Upload

On a SSH session to a very remote station I needed a way to upload a backup file to a Nextcloud file drop share through command line. After some fiddling I found this command to work:

$ curl -T <FILENAME> -X PUT -u "<FILESHAREID>:" -H "X-Requested-With: XMLHttpRequest" "<NEXTCLOUDBASEURL>/public.php/dav/files/<FILESHAREID>/<FILENAME>"

This just needs setting up a shared folder with file-drop and/or file create permissions. The rest is basically copying the file share id and the filename.