Code for uploading files to Nextcloud

I tried below commands.

https://docs.nextcloud.com/server/15/developer_manual/client_apis/WebDAV/basic.html#uploading-files

But getting error as https not allowed.

Any suggestions?

ok with python,powershell or even curl commands

This works for upload files:

Command is:

I tried this command

C:\Users\uday>curl -k -u ukreddy:password -T “C:\Users\uday\Downloads\gif.gif” “https://10.1.85.219/remote.php/webdav/files/ukreddy/t/gif.gif

<?xml version="1.0" encoding="utf-8"?>

<d:error xmlns:d=“DAV:” xmlns:s=“http://sabredav.org/ns”>
<s:exception>Sabre\DAV\Exception\NotFound</s:exception>
<s:message>File with name files/ukreddy/t could not be located</s:message>
</d:error>

There is folder “t” in my account root folder “ukreddy” can you suggest why this error comes…

THank you very much @gas85
It is working. Can you send a command for creating a folder also.

1 Like

Already answered you in other tread:

Just tested it and it works:

curl --user "user:pass" -X MKCOL 'https://DOMAIN/remote.php/webdav/Test_mkcol2'

Can you also send code for uploading complete folder also please

Do not want to be rough, but this cloud help https://duckduckgo.com/?t=ffab&q=webdav+upload+folder+curl
As you will notice there is no build-in way to upload folders, only file by file. In a github you will find different examples, e.g. this for php: