I have a http request in javascript that returns content of a file in the response. The response.body
is in readablestream format. I need to get the file content in base64 format and upload in a different location. Can I know what is the best approach to convert the content to base64 string?
var url="httpurl";
var dataContent= await fetch(url);
var textContent= await dataContent.blob();
Next line is to make https call to upload a file with content in base64 string format.
I would like to know how the datacontent can be converted to base64 string.
dataContent
is as in below image: