0

When I am trying to upload image using graph EndPoint then images are getting corrupted. Endpoint - PUT https://graph.microsoft.com/v1.0/drives/{drive_id}/items/{item_id}:/{file_name}:/content

Anything I am missing here?

SharePoint Message When trying to view uploaded (through above code)image. Tried without encoding as well. Even file name is not encoded then also its same behavior.

Note - This issue is with only images. Other files like PDF, CSV are working fine. enter image description here

stuartmccoll
  • 188
  • 1
  • 11
user1398291
  • 183
  • 1
  • 2
  • 15
  • Have you tried this - https://stackoverflow.com/questions/55919294/upload-an-image-file-to-sharepoint-via-api-graph? – Dev Sep 10 '20 at 07:34

1 Answers1

1

Changing form-data to binary solved my problem.

enter image description here

user1398291
  • 183
  • 1
  • 2
  • 15