# How to convert base64 string to binary-file and store on sftp

**URL:** <https://community.make.com/t/how-to-convert-base64-string-to-binary-file-and-store-on-sftp/5822>\
**Category:** Questions\
**Tags:** functions\
**Created:** [December 20, 2022, 10:20am UTC](https://community.make.com/t/how-to-convert-base64-string-to-binary-file-and-store-on-sftp/5822 "2022-12-20T10:20:38Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![cahore](https://avatars.discourse-cdn.com/v4/letter/c/67e7ee/32.png) [@cahore](https://community.make.com/u/cahore)\
**Post date:** [December 20, 2022, 10:20am UTC](https://community.make.com/t/how-to-convert-base64-string-to-binary-file-and-store-on-sftp/5822/1 "2022-12-20T10:20:38Z")

</div>

Hey to all you Makers,

So I ask my self how to convert base64 string to binary-file and store on sftp.

 ![Bildschirm­foto 2022-12-20 um 11.20.06](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/1/1daa7098b232ed1562ae516acc1a1d3d72c6db52.jpeg)

I tried it like so. But for some reason the image finally is broken so you can not open.  
What ist the problem?

Thanks for you support

Cahore

---

<div class="post-metadata">

**Author:** ![Bjorn.drivn](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/bjorn.drivn/32/4503_2.png) [@Bjorn.drivn](https://community.make.com/u/Bjorn.drivn)\
**Post date:** [December 20, 2022, 10:25am UTC](https://community.make.com/t/how-to-convert-base64-string-to-binary-file-and-store-on-sftp/5822/2 "2022-12-20T10:25:21Z")

</div>

Hi @cahore,

You would need to add a secondary parameter to the function.

```auto
toBinary(<base64 data>; base64)

```

---

<div class="post-metadata">

**Author:** ![cahore](https://avatars.discourse-cdn.com/v4/letter/c/67e7ee/32.png) [@cahore](https://community.make.com/u/cahore)\
**Post date:** [December 20, 2022, 10:44am UTC](https://community.make.com/t/how-to-convert-base64-string-to-binary-file-and-store-on-sftp/5822/3 "2022-12-20T10:44:08Z")

</div>

So you mean like this?

 ![Bildschirm­foto 2022-12-20 um 11.42.08](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/5/5a6e7c16b44cb4202be4f41bde1ab7c5a26cd514.jpeg)

But its still not working but it feels much closer 🙂

---

<div class="post-metadata">

**Author:** ![Wemakefuture](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/wemakefuture/32/103_2.png) [@Wemakefuture](https://community.make.com/u/Wemakefuture)\
**Post date:** [December 20, 2022, 11:16am UTC](https://community.make.com/t/how-to-convert-base64-string-to-binary-file-and-store-on-sftp/5822/4 "2022-12-20T11:16:10Z")

</div>

Hi. Be sure your final base64 starts with data:image/png;base64,…

If you need additional support, please don’t hesitate to reach out.

Cheers  
//HFBR

---

<div class="post-metadata">

**Author:** ![Bjorn.drivn](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/bjorn.drivn/32/4503_2.png) [@Bjorn.drivn](https://community.make.com/u/Bjorn.drivn)\
**Post date:** [December 20, 2022, 11:38am UTC](https://community.make.com/t/how-to-convert-base64-string-to-binary-file-and-store-on-sftp/5822/5 "2022-12-20T11:38:24Z")

</div>

@cahore No you have to add it to the toBinary() function like I explained:

 ![Screenshot 2022-12-20 at 12.37.49](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/1/1ab53581e2c09696de91809d75531e88e0386972.png)

> [@Wemakefuture](#):
>
> Be sure your final base64 starts with data:image/png;base64,

What do you mean with this? This is not related right now.

---

<div class="post-metadata">

**Author:** ![Wemakefuture](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/wemakefuture/32/103_2.png) [@Wemakefuture](https://community.make.com/u/Wemakefuture)\
**Post date:** [December 20, 2022, 11:46am UTC](https://community.make.com/t/how-to-convert-base64-string-to-binary-file-and-store-on-sftp/5822/6 "2022-12-20T11:46:33Z")

</div>

Show me the result for you base64

If you need additional support, please don’t hesitate to reach out.

Cheers  
//HFBR

---

<div class="post-metadata">

**Author:** ![cahore](https://avatars.discourse-cdn.com/v4/letter/c/67e7ee/32.png) [@cahore](https://community.make.com/u/cahore)\
**Post date:** [December 20, 2022, 12:19pm UTC](https://community.make.com/t/how-to-convert-base64-string-to-binary-file-and-store-on-sftp/5822/7 "2022-12-20T12:19:28Z")

</div>

Thanks a lot. Its working  
🥰

---

<div class="post-metadata">

**Author:** ![Will2](https://avatars.discourse-cdn.com/v4/letter/w/a587f6/32.png) [@Will2](https://community.make.com/u/Will2)\
**Post date:** [March 15, 2023, 12:01am UTC](https://community.make.com/t/how-to-convert-base64-string-to-binary-file-and-store-on-sftp/5822/8 "2023-03-15T00:01:40Z")

</div>

I have a similar issue with an image data:image/png;base64,

I follow base64 function as explained but still, the image in dropbox is broken. Any other steps to follow?

 ![Screen Shot 2023-03-14 at 8.01.12 PM](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/5/55bd741e71f593911cc99dbff43167dd12649f56.png)

---

<div class="post-metadata">

**Author:** ![Bjorn.drivn](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/bjorn.drivn/32/4503_2.png) [@Bjorn.drivn](https://community.make.com/u/Bjorn.drivn)\
**Post date:** [March 15, 2023, 12:32pm UTC](https://community.make.com/t/how-to-convert-base64-string-to-binary-file-and-store-on-sftp/5822/9 "2023-03-15T12:32:56Z")

</div>

Hi @Will2 ,  
That doesn’t look the correct value to use. A signature is most of the time only a value to identify the file is correct. You need to search for the actual data value.

---

<div class="post-metadata">

**Author:** ![Lucas\_Bernardes](https://avatars.discourse-cdn.com/v4/letter/l/a5b964/32.png) [@Lucas\_Bernardes](https://community.make.com/u/Lucas_Bernardes)\
**Post date:** [April 1, 2023, 10:06pm UTC](https://community.make.com/t/how-to-convert-base64-string-to-binary-file-and-store-on-sftp/5822/10 "2023-04-01T22:06:08Z")

</div>

I’ve the same issue. I’m trying to convert a existing base64 `"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA...` onto image.

I did the same thing above.

HTTP \> Parse \> Variable ({{toBinary(10.value; “base64”)}}) \> Google Drive

The image come broken.

---

<div class="post-metadata">

**Author:** ![Runcorn](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/runcorn/32/9169_2.png) [@Runcorn](https://community.make.com/u/Runcorn)\
**Post date:** [April 1, 2023, 10:17pm UTC](https://community.make.com/t/how-to-convert-base64-string-to-binary-file-and-store-on-sftp/5822/12 "2023-04-01T22:17:08Z")

</div>

> [@Lucas\_Bernardes](#):
>
> data:image/png;base64

Try removing the data:image/png;base64 from the String. It should work after that.

---

<div class="post-metadata">

**Author:** ![Lucas\_Bernardes](https://avatars.discourse-cdn.com/v4/letter/l/a5b964/32.png) [@Lucas\_Bernardes](https://community.make.com/u/Lucas_Bernardes)\
**Post date:** [April 1, 2023, 10:18pm UTC](https://community.make.com/t/how-to-convert-base64-string-to-binary-file-and-store-on-sftp/5822/13 "2023-04-01T22:18:12Z")

</div>

![ezgif.com-video-to-gif (1)](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/0/0ebbc022afae63c508ae81942e0bc61bc3a40c37.gif)

---

<div class="post-metadata">

**Author:** ![Lucas\_Bernardes](https://avatars.discourse-cdn.com/v4/letter/l/a5b964/32.png) [@Lucas\_Bernardes](https://community.make.com/u/Lucas_Bernardes)\
**Post date:** [April 1, 2023, 10:26pm UTC](https://community.make.com/t/how-to-convert-base64-string-to-binary-file-and-store-on-sftp/5822/14 "2023-04-01T22:26:13Z")

</div>

Works Perfectly! Thank you very much!

---

<div class="post-metadata">

**Author:** ![Make\_Bot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/make_bot/32/14661_2.png) [@Make\_Bot](https://community.make.com/u/Make_Bot)\
**Post date:** [September 22, 2023, 3:07pm UTC](https://community.make.com/t/how-to-convert-base64-string-to-binary-file-and-store-on-sftp/5822/16 "2023-09-22T15:07:08Z")

</div>


