|
Don't use the flag O_TEXTDATA. That should only be used when opening a text file. Once you have the file opened properly, you'll need to Base64 encode the binary data prior to writing it to the file. We use the open source program SNDM here to do this which takes care of all of the encoding. If you search on Google, you'll find the website that you can download it from. Matt -----Original Message----- From: Thompson Matthew [mailto:Matthew.Thompson@xxxxxxx] Sent: Friday, May 14, 2004 11:24 AM To: 'rpg400-l@xxxxxxxxxxxx' Subject: PDF Attachments using IFS API's I'm using IFS API's (open, read close etc) to create IFS MIME email messages in order to send an email using QtmmSendMail API. If I want to incorporate PDF data files as attachments to my MIME document, what parameters will I need to specify when opening the PDF using the "open" API? To open my MIME document I'm specifying: fullName = %trimr( fileName ) + null; fileDesc = open( %addr( fullName ) : o_creat + o_wronly + o_trunc + o_codePage : s_irwxu + s_iroth : asciiCodePage ); returnInt = close( fileDesc ); fileDesc = open( %addr( fullName ) : o_textdata + o_rdwr ); To open my PDF document I'm specifying: AttachDesc = open(%addr(fullnameAt) :o_rdonly + o_textdata : s_irusr + s_iroth : asciiCodePage ); My attachment header MIME script is like the following: ----PART.BOUNDARY.20040514150013371000 Content-Type: application/octet-stream; name="QPADEV000Z-Friday-14-ASA-2531.pdf" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="QPADEV000Z-Friday-14-ASA-2531.pdf" Any ideas about what I'm doing wrong? Matthew Thompson UBS Global Asset Management +44 (0207) 901 5136 ______________________________________________________________________ Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.