Question

Sending a Binary File to S3 Using Webhooks by Zapier

  • 3 July 2023
  • 5 replies
  • 193 views

Userlevel 5
Badge +1

Hey Experts! I'm encountering an issue I'm sure others have faced previously and would love some insight.As a part of a larger Zap, I am looking to send a binary file to an AWS S3 bucket.

The file is originally an attachment received by an Email by Zapier trigger.However, I am either not doing it correctly, or the Hydrate file is not something that S3 can accept.

It is returning the 'hydrate' file from S3, when it usually just responds back 200 with nothing else (when doing this in Postman).

I previously found this community answer, but it's not helpful. https://community.zapier.com/code-webhooks-52/how-to-put-a-binary-file-in-a-body-using-webhooks-15457


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

5 replies

Userlevel 7
Badge +14

Hi @BlakeBailey 

Good question.

To help give us more context, please post detailed screenshots with how your Zap steps are configured.

Userlevel 5
Badge +1

Hi @BlakeBailey 

Good question.

To help give us more context, please post detailed screenshots with how your Zap steps are configured.

Okay!

I’ve got an Email by Zapier step that is receiving an email that has a PDF file attachment. 

 

Later, I make a request to S3 that gives me a pre-signed URL to send the file to. 


That URL is then where I make a PUT request and should be able to send the Binary file. This is what that looks like in Postman:


This is the response I get in Postman for that request: ​​​​​​​


However, in Zapier, I send the same file, but it doesn’t work (it says it does, but replies with the same ‘hydrate’ file as I had sent, and nothing is actually uploaded to S3). 


Here is that step in the editor (I’m doing a custom request - tried a regular PUT but I don’t believe that’s right):​​

@Troy Tessalone Thanks in Advance!

Userlevel 7
Badge +14

@BlakeBailey 

Can you give us more context with screenshots about the purpose of each Zap step?

What is the link to the API documentation you are referencing to configure step 4?

Userlevel 7
Badge +14

@BlakeBailey 

If you use a Webhook - PUT action instead of a Webhook - Custom Request (PUT), then there is a field for File.

 

Userlevel 5
Badge +1

No API Documentation, it’s a long story but I reverse-engineered an in-house set of API calls our app makes, though I’m sure there is documentation to be found through AWS (I’ve looked and can’t find it). 

As for using the built-in PUT action with the file field, it still does not work.