How to fetch MS graph user photo as a blob url and store them in the application db as blob url

Viewed 229

I tried using the responseType as blob but it returns the binary data. I can leverage react frameworks to do any extra operations needed to accomplish it.

enter image description here

Below is what I tried,

Converted the binary to blob, but this blob cannot be stored in the DB or use it later as it has "localhost" url.

enter image description here

1 Answers

It's not an excellent choice to store the blob URL in DB. Blob URLs are temporary. Images for this link will be taken from the cache.

So, it is better to convert the blob into buffer and store that in the S3 bucket and update the Location of the S3 bucket to DB

Related