Hallelujah! You pointed me on the right path, and after a lot more googling along that line, trial & error testing, I stumbled accross the answer ![]()
The key things are:
- Format the request body as a multi-part form.
- It’s confusing and complex, and I don’t fully understand (like why certain things like the fileName works in the header, but folderPath needs to be in the body) but hey - it works!
- The file content needs to be converted from Base64 (or whatever format you might have gotten it in) into Binary.
This is what the request looks like:
And this is the code for copy/paste:
(Bear in mind the file body is dynamic content so you’d replace that with your binary file data)
{
"$content-type": "multipart/form-data",
"$multipart": [
{
"headers": {
"Content-Disposition": "form-data; name=\"options\""
},
"body": "{\"access\": \"PRIVATE\"}"
},
{
"headers": {
"Content-Disposition": "form-data; name=\"file\"; fileName=\"Test.pdf\""
},
"body": @{base64ToBinary(outputs('Get_file_content')?['body']?['$content'])}
},
{
"headers": {
"Content-Disposition": "form-data; name=\"folderPath\""
},
"body": "/Uploaded Documents"
}
]
}
