Corrupt PDF Attachment Sent

Hi
I am using make’s mailhook, knack and outlook 365.
Should be a simple process - I send a mail to the mailhook, the record is retrieved from knack, a pdf file stored in the knack record is then sent as as attachment to an email via via outlook 365.
Everything is working including the mail being sent to the correct email address, the only issue is that the pdf file that arrives as the attachment cannot be opened as a pdf. I get a message that the file is corrupted or incase of adobe reader, damaged and may have been sent as an attachment but was not correctly decoded.

Scenario:

Knack “Get a Record” - Attachment field retrieved:
CleanShot 2022-05-08 at 11.44.02

Outlook field:
CleanShot 2022-05-08 at 11.47.28

Error message:

Really appreciate any advice as to what I am doing incorrectly.
Regards
Mark

The knack attachment will have to be downloaded as a binary data blob rather than a link. You’ll need to download the pdf into Make right after the router on the path to the outlook module. You can use the http module to do that. And then link the binary data output at an attachment to the outlook email in the data attribute of the attachment.

1 Like

Many thanks @alex.newpath
Got it working!

Hi @alex.newpath

I am now sending a file the other way - into knack from an email attachment. The file field in my knack database appears to be updated with a pdf file however, the file will not open. Get the same message about “file corrupted” when trying to open in a pdf reader.

I looked at inserting an HTTP module between the dropbox “file rename module” and the Knack “upload a file” module, but there is no url to use in the HTTP parameters?

My scenario:
Mailhook received email with an attachment
Attachment is uploaded to DropBox
Attachment is renamed on Dropbox
File Uploaded to Knack
Knack record created and upload file updated to “fileField”

Any suggestions?
Thank you

You should be able to get the binary data of the attachment for the mail hook module. Maybe share the knack upload file module details so I can see what it is available?

Hi Alex

Sorry only responding now. I am sharing the knack upload file module details -

As brief reminder, when i send pdf document to knack, the pdf is always uploaded in a corrupted format that is not viewable. (The renamed file in Dropbox is perfect.)

Really appreciate any advice or pointers where to resolve.

Regards

Mark White