I use a web-based tool (Webform) to submit project information and files. When I fill out the webform, upload the files, and hit submit, the data is sent directly to Make via a webhook. I want to upload files directly to OneDrive (SharePoint). The file uploads to SharePoint, but when I open it, an error appears stating the data does not exist.
Then, I added a OneDrive module to upload the file, which uploads successfully to SharePoint, but opening the file results in an error indicating the data does not exist.
Hi @Urjit_Hirani - try extracting just the base64 string from the data key you receive in your webhook.
data:application/pdf;base64,<THIS IS THE BASE64 STRING>
You can use a split() function to split the string into two parts - one containing data:application/pdf;base64 and the other containing <THIS IS THE BASE64 STRING>.
And then use last() formula to grab only the second part:
{{last(split(1.files[].data; ","))}}
When you include that in your current toBinary() formula, it will look like this:
Try copy-pasting the above formula in your “Set Variables” module or directly in the OneDrive module instead of the 1 variable. Report back if that won’t work.
Hi @SierraV, I tried the way you mentioned, and it worked in one run. Now I know where I went wrong; instead of taking only , I was taking the entire dataset, including application/pdf:base64.
Thank you for helping me with this issue quickly; I appreciate it a lot.