1
votes

I cannot upload a photo from Microsoft Graph Explorer. I am getting this error:

An internal server error occurred. The operation failed., The file you chose isn't an image.

I have image/jpeg as content-type and a valid binary data extracted from Fiddler. Authorization token is also there when I inspect my request from Fiddler. What did I missed?

Request body: https://pastebin.com/YDUfpRmX

Response: https://pastebin.com/e6fzDYvi

PUT https://graph.microsoft.com/beta/users/[userprincipalName]/photo/$value HTTP/1.1

Content-Length: 64408

Authorization: Bearer eyJ0eXA...

Content-Type: image/jpeg
1
Without more information (i.e. the Fiddler trace, the URI, etc), there isn't much we can help with. Please update your question with more data.Marc LaFleur
Thanks Marc. I have updated my question with more data.Sharepoint_charmer
happens as well in me/photo endpointSharepoint_charmer
Given that you need to read the file into memory in order to include it in the body, I'm not quite sure this would work with Explorer. As soon as you paste the file contents into a text editor you have effectively serialized the data.Marc LaFleur

1 Answers

1
votes

Graph Explorer doesn't support sending binary files at the moment. It can only handle string data in the POST/PUT/PATCH body.