I can't upload 3 files from the right path

Describe the issue/error/question

I have a problem - in the Nextcloud node, I need to upload 3 files to one specific folder, which lies inside another folder, when I execute it, it turns out that the first file is uploaded where it needs to be, and the other two are simply put in the root folder.

Please share the workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 0.215.2
  • Running n8n via [Docker ]:

Hi @sadsergius, based on your description it looks like your webhook only has a single item, but your Nextcloud node actually gets three items. So you probably ran into this problem here.

Instead of using an expression like /{{ $node["Webhook"].json["body"]["name"] }}/{{Object.keys($node["Webhook"].json["body"])[0]}}/{{$binary.data.fileName}}, could you try the one below?

/{{ $("Webhook").first().json["body"]["name"] }}/{{Object.keys($("Webhook").first().json["body"])[0]}}/{{$binary.data.fileName}}

Using .first() should always point to the first (and only) item of your Webhook node, hopefully avoiding this problem.

Thank you very much!

1 Like

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