# Using Nextcloud, webdav and node-red

**URL:** <https://discourse.nodered.org/t/using-nextcloud-webdav-and-node-red/24072>\
**Category:** General\
**Created:** [2 April 2020 08:28 UTC](https://discourse.nodered.org/t/using-nextcloud-webdav-and-node-red/24072 "2020-04-02T08:28:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nxito](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nxito/32/88293_2.png) [@Nxito](https://discourse.nodered.org/u/Nxito)\
**Post date:** [2 April 2020 08:28 UTC](https://discourse.nodered.org/t/using-nextcloud-webdav-and-node-red/24072/1 "2020-04-02T08:28:07Z")

</div>

I am trying to list and upload a file to nextcloud with node-red  
I have tried using the kuehnelbs node/node-red-contrib-nextcloud  
I was successful in the listing but uploading gave me an error :  
**"self signed certificate in certificate chain"**  
(which I'm looking at now what it is)( I asked the author, but he doesn't answer)

I have also tried to use the Webdav library directly, but it gives me the same error and no results

With webdav i use:

> const webdav = global.get("webdav")  
> const https = global.get("https")  
> var server = {address:"[https://myip/nextcloud/remote.php/webdav/](https://myip/nextcloud/remote.php/webdav/)",  
> user:"",  
> password:"",  
> insecure:true,  
> },  
> directory = "/"  
> node.warn(server)  
> var client = webdav.createClient(  
> server.address, {  
> username: server.user,  
> password: "server.password",  
> digest: true,  
> }  
> );  
> node.warn({client:client})  
> node.warn(directory)  
> const option = {}  
> if (server.insecure) {  
> option.agent = https.Agent({ rejectUnauthorized: false })  
> }  
> node.warn(option)  
> msg.directoryItems=client.getDirectoryContents(directory, option)  
> .then(function (contents) {  
> node.send({ 'payload': contents })  
> }, function (error) {  
> node.error({error: error})  
> })  
> return msg

things to note: use windows and node-red 1.0.3

If someone has used nexcloud with node-red or knows how to correct this error, I would appreciate it

---

<div class="post-metadata">

**Author:** ![Bobo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bobo/32/8401_2.png) [@Bobo](https://discourse.nodered.org/u/Bobo)\
**Post date:** [3 April 2020 02:37 UTC](https://discourse.nodered.org/t/using-nextcloud-webdav-and-node-red/24072/2 "2020-04-03T02:37:49Z")

</div>

If IRC there are two versions of this node that have been published.

I am using @kuehnelbs/node-red-contrib-nextcloud **v0.1.3 and I don't get this error**.

Indeed, I am not getting any errors, nor am I getting any files either.

So it appears that the "list" node works ok, but the other nodes may be problematic. Pity.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [2 June 2020 02:38 UTC](https://discourse.nodered.org/t/using-nextcloud-webdav-and-node-red/24072/3 "2020-06-02T02:38:03Z")

</div>

Closed on 2 June 2020 02:38 UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
