# Nextcloud Upload using base64 encoded string

**URL:** <https://community.n8n.io/t/nextcloud-upload-using-base64-encoded-string/10685>\
**Category:** Questions\
**Created:** [January 17, 2022, 9:57am UTC](https://community.n8n.io/t/nextcloud-upload-using-base64-encoded-string/10685 "2022-01-17T09:57:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcalonso](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jcalonso/32/9819_2.png) [@jcalonso](https://community.n8n.io/u/jcalonso)\
**Post date:** [January 17, 2022, 9:57am UTC](https://community.n8n.io/t/nextcloud-upload-using-base64-encoded-string/10685/1 "2022-01-17T09:57:10Z")

</div>

## Describe the issue/error/question

Hello!

I am trying to upload a txt file to Nextcloud using a base64 encoded string as source, and decoding it before the save. But it ends being an blank line in the file.

My expression looks like:

```auto
{{ atob("SGVsbG8gV29ybGQh") }}

Test

```

The function finishes successfully but the txt file only contains the `Test` line:

```auto

Test

```

The interesting thing is that I can see the output correctly decoded in the expression preview window.  
So the issue is only when running the workflow.

## What is the error message (if any)?

None

### Node config

## Information on your n8n setup

- **n8n version:** 0.159.0
- **Database you’re using (default: SQLite):** SQLite
- **Running n8n with the execution process [own(default), main]:** main
- **Running n8n via [Docker, npm, n8n.cloud, desktop app]:** Docker

---

<div class="post-metadata">

**Author:** ![RicardoE105](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ricardoe105/32/550_2.png) [@RicardoE105](https://community.n8n.io/u/RicardoE105)\
**Post date:** [January 17, 2022, 6:57pm UTC](https://community.n8n.io/t/nextcloud-upload-using-base64-encoded-string/10685/2 "2022-01-17T18:57:15Z")

</div>

Try with `{{Buffer.from("SGVsbG8gV29ybGQh", 'base64').toString()}}` instead.

---

<div class="post-metadata">

**Author:** ![jcalonso](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jcalonso/32/9819_2.png) [@jcalonso](https://community.n8n.io/u/jcalonso)\
**Post date:** [January 17, 2022, 11:22pm UTC](https://community.n8n.io/t/nextcloud-upload-using-base64-encoded-string/10685/3 "2022-01-17T23:22:46Z")

</div>

Thanks @RicardoE105 that worked perfectly!
