0

I have a requirement to take a file (base64) and upload it to SharePoint Online document library using a call to the RESTful endpoints.

When I do this the file ends up in SharePoint Online document library in the format of "application/octet-stream; charset=binary" even though the file is a .jpg file. The file extension is set in SharePoint Online document library correctly but the file will not open.

I cannot do a conversion of the file from base64 beforehand because the system that the file is being uploaded from cannot store files (unix) for conversion.

What do I need to set in the headers of the upload when calling the REST endpoint to make sure the file is uploaded as the correct format?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.