PDF Attachment

I’m receiving a PDF attachment as a base64 encoded string to a service. I need to save this to the filesystem. I’m using the following services:

base64Decode → bytesToString – writeToFile

The file is saved but the pdf document is empty when I open it. I’m able to email the document to myself by using:

base64Decode → smtp and setting the content of the attachment equal to the result of the base64Decode

I know the pdf document is valid because I’m able to read it from my email attachment.

Is there something I’m missing to get this file to save correctly to the filesystem?

Thanks,

Kevin

Skip the bytesToString. That’s what’s messing it up since a pdf byte stream is not a String. Just write the bytes to the file.

Kevin, did the removal of the bytesToString call do the trick?