I’m working with Zapier webhooks to handle files sent from a Slack integration. My setup includes a Slack application built with the botkit framework that forwards uploaded files to Zapier through webhook calls.
The issue I’m facing is that Zapier doesn’t handle the webhook data properly in its standard format, so I have to work with raw binary data instead. Is there a method within Zapier to transform this raw binary information back into a usable file format? My goal is to take a JPEG image and upload it to Google Drive through Zapier.
I believe this approach might work:
var httpClient = require('http'),
fileSystem = require('fs');
httpClient.get(webhookData, function(stream) {
stream.pipe(fileSystem.createWriteStream('image.jpeg'));
});
result = {fileId: 1};
This should reconstruct the JPEG file, but I’m unsure how to make this file available as output for Zapier’s next steps.
I’ve hit this same issue with binary files in Zapier. The filesystem approach won’t work - Zapier’s webhooks don’t persist files like that. Here’s what fixed it for me: capture the binary data as a buffer first, then convert to base64 before passing it through. You’ll need to tweak your request handler to collect the binary chunks properly before converting. Once you’ve got the base64 string, pass it straight to the Google Drive action. Just remember to set the right MIME type (image/jpeg for you) in the metadata. Main thing is keeping the binary data intact during the webhook transfer.
Your code’s close, but there’s a key issue with how Zapier works. You can’t use the filesystem approach because Zapier webhooks run in a stateless environment - no disk writing allowed. You need to handle everything in memory instead. Don’t pipe directly to Zapier. First, collect the response data from your Slack request, then encode it as base64 before hitting the webhook. Collect all chunks in a buffer, use buffer.toString('base64') for the encoded string, then send that base64 data with the filename and content type in your webhook payload. Zapier’s Google Drive step can decode the base64 back to the original file.
Been there with binary files. Everyone’s pushing base64, but you’re just making things harder than they need to be.
You need a platform that handles files natively without all the encoding nonsense. I’ve done tons of Slack to Google Drive setups - modern tools handle binary data way better.
Your current approach is a mess of failure points: capture binary → convert to base64 → pray Zapier doesn’t screw it up → hope Google Drive decodes properly.
Why wrestle with Zapier’s limitations? Use something built for this stuff. I’ve automated dozens of file workflows from Slack to cloud storage. The trick is finding platforms that treat files properly instead of forcing you to hack around with encodings.
Latenode does Slack to Google Drive transfers without any base64 conversion or binary handling headaches. Set up the Slack trigger, connect to Google Drive, done. No middleware code required.
yep, converting it to base64 is def the way to go. just do Buffer.from(data).toString('base64'), then you can hook it up to google drive in zapier. should work like a charm!