Is uploading files to a zapier webhook via POST allowed?
I didn't manage to get it working. In my form, I have some text inputs (name, email etc), and one <input type="file" name="cv" />
. Here's my AJAX code:
$('#__formID__').submit(function(e) {
var data = new FormData($(this)[0]);
console.log(data.get('cv'));
$.ajax({
url: 'https://hooks.zapier.com/hooks/catch/someid/someid/',
type: 'POST',
// Form data
data: data,
// Tell jQuery not to process data or worry about content-type
// You *must* include these options!
cache: false,
contentType: false,
processData: false,
});
});
The file (cv) does get sent, I see the correct console.log above, and I see this in the Request Payload (in Chrome console):
------WebKitFormBoundary4sbU6QlU3xl7ox2f
Content-Disposition: form-data; name="name"
John Doe
------WebKitFormBoundary4sbU6QlU3xl7ox2f
Content-Disposition: form-data; name="university"
BLABLABLA
------WebKitFormBoundary4sbU6QlU3xl7ox2f
Content-Disposition: form-data; name="email"
john.doe@gmail.com
------WebKitFormBoundary4sbU6QlU3xl7ox2f
Content-Disposition: form-data; name="skype"
johndoe
------WebKitFormBoundary4sbU6QlU3xl7ox2f
Content-Disposition: form-data; name="skills"
dsaf
------WebKitFormBoundary4sbU6QlU3xl7ox2f
Content-Disposition: form-data; name="cv"; filename="cv-fr.pdf"
Content-Type: application/pdf
------WebKitFormBoundary4sbU6QlU3xl7ox2f--
But on the Zapier side, I receive every attribute except the cv
one:
name: John Doe
university: BLABLABLA
skills: dsaf
skype: johndoe
email: john.doe@gmail.com