I am trying to use a SharePoint request action in Power Automate to upload a file to a library. I'm running into an issue that I've seen many others who have attempted this either using the SP JSOM or jquery/ajax calls in that any file other than a 'txt' is corrupt when uploaded.
Does anyone know how to properly use PowerAutomate to upload a file to SP with REST?
I am converting the my base64 string into binary via the base64tobinary() expression. Uri endpoints and headers are as follows:
method: post
uri: _api/web/lists/getbytitle('shareddocs')/RootFolder/files/add(overwrite=true,url='filename')
headers: {
accept: application/json; odata=verbose,
content-type: application/octet-stream
}
body: base64tobinary('base64var')