Transfer files from remote host to nextcloud webdav

Hi everyone, I quote an example of the “curl” command to transfer a file from a remote host to a webdav nextcloud (upload only).

curl -T /tmp/myfile.txt -u 'JDzF3anjSQX2Ymm:' -H 'X-Requested-With: XMLHttpRequest' https: //myserver.neth.lan/nextcloud/public.php/webdav/

The -u option is the final part of sharing.
The command was tested by Ubuntu client, firewall pfsense, raspberry PI 3 with raspbian.
I hope it can come in handy.

1 Like

Could you elaborate a bit? How can be obtained?

Yes, it is the final part of sharing, and the colon would be the password which in this case is null.

1 Like

Is this script related?

I would not know in particular, I had seen some on the internet for this command and in the end trying a little all this is what worked.

Hi here is what I did to upload:
As shown in the figure, I create a public folder for uploading and editing only. Then click on the copy link button. In the final part of the connection there is the reference string which, as from the previous post, is shown in the syntax of the curl command.
Hello and sorry for the delay.
curl

1 Like