cancel
Showing results for 
Search instead for 
Did you mean: 

Transfer files from FTP to binary record

nonecked
Deputy Chef I
Deputy Chef I

Hi all. I'm trying to pull data from FTP server and create a record to another table by setting it as binary. However, when I'm using the download file contents from FTP server it gives me the file content not the file itself. May I know what are your solutions or suggestions? Thanks!

1 REPLY 1

marlon-muela
Workato employee
Workato employee

Hi @nonecked ,

This is Marlon from the Support Team.

The download action will get the file contents. There are different ways to handle file contents that need to be transformed and moved to a record/table.

To transform a file's content to binary in Workato, you can use the Base64 encoding and decoding features. Here are the steps you can follow:

  1. Download the File Content: First, download the file content from the source system. This can be done using the appropriate connector and action, such as "Download file" from Dropbox, Google Drive, or any other supported service.

  2. Base64 Encode the Content: Use Workato's formula to encode the file content to Base64. This converts the binary content into a set of standard characters, which can be useful for transferring over networks or storing in systems that require Base64 encoding.

    • Formula for encoding: Base64.encode(file_content)
  3. Base64 Decode the Content: If you need to convert the Base64 encoded content back to binary, use the decoding formula.

    • Formula for decoding: Base64.decode(encoded_content)
  4. Upload the Binary Content: Finally, upload the binary content to the destination system using the appropriate connector and action, such as "Upload file" or "Upload file using file contents"

For more detailed instructions and examples, you can refer to the Workato documentation on handling binary files and Base64 encoding: