Displaying an image from S3

@justin unfortunately this issue also happens when uploading a file to S3 using the “Upload data” action from the s3 resource (Only binary content type is selectable)

From further research, this should not be an issue as calling btoa() on the data should return the correct base64-encoded image or file. However, btoa() crashes when being called on the data.Body object returned by the “Read file from S3” action (Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.)

Workflow:

  • Upload a b64 encoded image/file using the “Upload data” action type, “Binary” file type (atob is called in the background by the uploader)
  • Verify that the image is correctly uploaded on S3
  • Read the image using the “Read file from S3” action, you get a “binary string” in data.Body as per the screenshot in my first post
  • Create a transformer for the above action: return btoa(data.Body)

Expected result: You get your original file back
Actual result: Crashes with Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.

In other words: btoa(atob(str)) should be equal to str even if passing through S3. I’m not sure if I’m missing something here, as I’m pretty new to all this, but I think that should hold true.

Thanks!