Using ssh2SftpClient in Workflows

Can I just check how do I turn data into a buffer/file stream that can be used in the ssh2SftpClient plugin?

I tried to use btoa but I get an error saying

[info] unhandledRejection Error: put: Bad path: dGVzdGluZw== not exist

Hey Ernest! Sorry for the delay here. I wanted to sync with my team before getting back to you to make sure I was understanding correctly. To clarify, you're looking for the syntax to convert a binary string to buffer?

Since btoa converts to a base64 string, I think you can convert the output from that to a buffer with ArrayBuffer, though that might not be exactly what you're looking for. Let me know! :slight_smile:

Hi Victoria,

Managed to get this working, ended up using Buffer.from(str) to get the buffer for upload.

It was just confusing because it complains that Buffer is not defined.
CleanShot 2023-06-21 at 19.06.26@2x

Hope this helps others!

Amazing! So glad to hear it + will look into the confusing Buffer linting.

Thank you for posting this, I'm sure it will help other users :hugs: