Extracting File Attachments from Emails

Archive of postings to DataStageUsers@Oliver.com. This forum intended only as a reference and cannot be posted to.

Moderators: chulett, rschirm

Locked
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Extracting File Attachments from Emails

Post by admin »

Hi All,

I am aware of a DataStage Suit called ClickPack, that can perform email transformations such as extracting the textual contents of an email, but does anyone know if there is a way within DataStage, that File Attachments within an email can be extracted, and saved to a nominated location. Any help on this topic would be appreciated. Thanks

Shaun Jackson
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

Hi Shaun,

I dont know if you mean "is there a way, other than using ClickPack, of extracting file attachments". But within ClickPack, there is a routine CPLandFile (in the Email category) which can write email enclosures to file. Heres its long description:

---

Decodes MIME-encoded data which is passed in as a parameter, and places the decoded data into a target file.

The type of encoding is specified as a parameter, as is the directory and name for the target file. Any existing file in the directory with the same name will be overwritten.

Normal return value is the empty-string. For an unrecognised encoding, an error string will be returned.

---

Regards

- Chris Thornton
Locked