I have a webhook from an external app. That is sending files that are submitted.
I have a flow
I have a trigger in the flow "When an HTTP Request is received"
The webhoook sends as "multipart/form-data" type
So cant generate a schema, just leave blank.
Can't parse json, since not json
I can try to do splits, replaces, etc.
But it is very messy and it seems like when you convert to string for the replaces, it changes the base64 content to something else? XML?
What is the best way to do this? Below is an example of what the webhook sends.. the content has been removed from the word document, there will always be 1 resume, 1 aadhar card, 1 pan card but could be multiple pay documents...:
{
"$content-type": "multipart/form-data; boundary=1924ec1e13c",
"$content": "<CONTENT BASE64>",
"$multipart": [
{
"headers": {
"Content-Disposition": "form-data; name=\"pancard\"; filename=\"resume.docx\"",
"Content-Type": "application/x-tika-ooxml",
"Content-Length": "14777"
},
"body": {
"$content-type": "application/x-tika-ooxml",
"$content": "<CONTENT BASE64>"
}
},
{
"headers": {
"Content-Disposition": "form-data; name=\"aadhardcard\"; filename=\"aadhar.txt\"",
"Content-Type": "text/plain",
"Content-Length": "6"
},
"body": "aadhar"
},
{
"headers": {
"Content-Disposition": "form-data; name=\"payslips\"; filename=\"pay2.txt\"",
"Content-Type": "text/plain",
"Content-Length": "3"
},
"body": "pay"
},
{
"headers": {
"Content-Disposition": "form-data; name=\"payslips\"; filename=\"pay.txt\"",
"Content-Type": "text/plain",
"Content-Length": "3"
},
"body": "pay"
}
]
}