Forum Stats

  • 3,827,218 Users
  • 2,260,751 Discussions
  • 7,897,187 Comments

Discussions

convert pdf file to base64

Ayala01
Ayala01 Member Posts: 1 Green Ribbon

Hello everyone. Please your support. I'm using Visual Builder and I already have the option to upload a PDF file. I must send that file through a standard API so that the PDF can be attached to the ERP. I already have the API and can now load the file on the screen, but I need to convert the PDF file to base64 so that it can be read by the API.

I am using this code in the JS: btoa(fileSet)); // fileSet is the uploaded file.

This returns me Base64 but when I open the PDF it shows that the file is damaged. This returns me Base64 but when I open the PDF it shows that the file is damaged.

Answers