Convert multiple files to base64 javascript

LucasLucas Posts: 1

We are working on a project where we need to make an REST API call in which the body of the request has an attachments field. The attachments need to be converted to base 64. The problem is that we need to send multiple attachments through the API request (the number of files is variable), so the "File encoding format" in "Web API: Send PUT request" action wouldn't work for us. Bellow is the JSON object that we need to send in the body of the request.

We are thinking of creating a Javascript code to get the file name and convert the file to base64, and then output the final JSON object. Does anyone have an idea of how to implement this code?

Sign In or Register to comment.