Uploading .PDF's to SFTP

Hi, I’ve created a scenario where Make monitors my email, if there’s an attachment it then uploads it to an SFTP. This worked fine for about 3 days after which it just started to upload .pdf’s that are blank, the file size is legit but there’s no actual content when viewing the file, just a white, empty .pdf.
Not sure what the problem is as it worked well and nothing changed on the email and sftp end.

Any help would be appreciated.

Hey Dusan,

can you go to the scenario history and share the bundles from there? What was sent to the SFTP and what the result was?

Hi Stoyan, I’ve found the scenario history. Could you tell me how I can share that info with you ?

The output bundle just shows: [null]

I’ve attached a screenshot of the operation/error.

I should mention that I also have another module attached after the SFTP. It’s a Telegram module that uploads the same file/s to a Telegram chat. The .pdf’s uploaded there are also blank as previously mentioned.

Here’s a screenshot of the SFTP module settings:

First add a filter after the watch module to make sure there are attachments. Then add an iterator to go through the attachments array and then map the results from the iterator in the SFTP module.

On a side note, you can replace the Watch Emails module with a custom mailhook module to get instant triggers that come only when a new email arrives, instead of running on a timer.

Just did as you instructed and the BundleValidationErrors are gone but the .pdf’s are still blank.

Here’s what the setup looks like now…



Another thing to mention, I tried completely removing the SFTP module and just leaving the Email watch and Telegram modules, it produced the same result, blank .pdf’s.

But from the email it self you can still open them?

Yes, opening via email works fine, shows the .pdf properly.
I thought it might be an issue with the .pdf file itself but the problem is present with all emails, all with different .pdf files from different people.

Well it turns out the problem was fixed with this suggestion, I just forgot to map the file iterator for the Telegram module and that is where I was checking the .pdf files.

All in all, seems to be fixed now, thank you very much for that.

If I mark this as fixed now will it close the topic ?

I wanted to ask if you could elaborate on your suggestion for adding a custom mailhook module, I found that option in Make but what do I need to do on the mail server to make sure everything works ?

Ah sorry, aren’t the attachments coming in as URLs? Can you check the output of the Email module?

To be honest I have no idea…

The attachments section of the output Email module is showing this:

“fileName”: “1.12041911-09-2024.pdf”,
“contentType”: “application/pdf”,
“checksum”: “2306298b08c…”,
“fileSize”: 294392,
“data”: "IMTBuffer(294392, binary, cdd…

I shortened the “data” and “checksum” with dots, otherwise it’s a very long code.

Is this what you were looking for ?

Ok, so it is the files them selves. Can you try uploading them elsewhere to see if it will work? Maybe to a google drive?

I’m not sure I understand, are you still referring to the custom mailhook module solution ?

Because I wrote that the current module setup I have now is fixed/working thanks to your initial suggestion of adding a filter to check for attachments and an iterator which is mapped to the sftp module.

If this message is still regarding the custom mailhook module can you please explain how Google Drive helps in this situation ?