2

I want to get a pdf file content array from one of my sharepoint libraries and encode it to base 64 now it works with this ajax request:

$.ajax({ url: "/sites/pae/_api/web/GetFileByServerRelativeUrl('<url>')/$value?binaryStringResponseBody=true", type: "GET", binaryStringResponseBody: true, success: function(data){ console.log(data) }, error: function(data){console.log(data)} });

but the problem is that it returns a string with unrecognizable characters which makes it impossible to convert to base64

Is there a way to decode it from utf8 or to bring it directly with base64?

0 Answers0