PDA

View Full Version : saving pdf attachment from eMail listener


stefanpeeters
03-27-2007, 08:27
Hello

I receive a pdf file through my eMail listener.
When I save it to a file I get an empty pdf document
GetBodyPartContent
streamToString
writeToFile

When I do a base 64 decoding a get an invalid pdf format error
GetBodyPartContent
streamToString
base64Decode
byteToFile

Other order of flows give errors about wrong variable types.

I've been looking in vain through the forums for an answer.

Can anyone help me please?

Stef

reamon
03-27-2007, 10:55
Stop calling streamToString. PDF data is not a string. Write the stream or bytes to file. Do not try to convert it to a string.

stefanpeeters
03-28-2007, 04:15
A working solution:

pub.flow:getTransportInfo
pub.io:streamToBytes
bytesToFile

with thank to my american Fisher colleague and reamon

stef