13,734 questions
Uploading Excel file to Sharepoint using Graph API can't open/corrupted.
Dreyo
5
Reputation points
Endpoint: https://graph.microsoft.com/v1.0/drives/${driveID}/root:/${folder}/${filename}:/content
Content-Type: text/plain
Filename: Test.xlsx
I have an excel file with multiple sheets, i uploaded it to my system and should trigger the sharepoint upload.
The excel file was uploaded to sharepoint but when I open the sharepoint an error pops out:
This is how i converted excel file to Binary:
var file = document.getElementById("myFile").files[0];
var reader = new FileReader();
reader.onload = function(ev) {
var array = ev.target.result;
var fileByteArray = [];
for (var i = 0; i < array.length; i++) {
fileByteArray.push(array[i]);
}
Microsoft Security | Microsoft Graph
Sign in to answer