photo
1 TopicHow to create an <img> tag containing MSGraph photo/$value response BLOB
I'm creating a Sharepoint Application (using Shrepoint Framework) and I'm not being able to retrieve the Pohto BLOB returned when calling MSGraph "/me/photo/$value" api. I don't know how to convert the BLOB into a Base64 string. I know that the responseraw.body is a readable stream, but don't know hot to access it and use as a SRC of a IMG tag. I have made many attempts, I'm writing one to explain what I'm trying to accomplish: this.context.msGraphClientFactory .getClient() .then((client: MSGraphClient): void => { client.api('/me/photo/$value') .get((error, response: any, rawResponse?: any) => { const blobUrl = window.URL.createObjectURL(rawResponse.body); document.getElementById("myPhoto").setAttribute("src", blobUrl); }); }); This code fails because creteObjectURL has been deprecated. The MSGraph call works, but I can't process the response. Any suggestions?1.2KViews0likes1Comment