That is an option to pre-convert the file on the IFS... yes, that might be useful.

Thank you Bryan.

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Bryan Dietz
Sent: Wednesday, April 11, 2012 12:12 PM
To: RPG programming on the IBM i / System i
Subject: Re: base64 Encode a tiff image.

would something like this work for you?

http://www.systeminetwork.com/article/application-development/sha1-md5-and-base64-without-apis-63029

SHA1, MD5, and Base64 Without APIs
Date Posted: January 15, 2009 12:00 AM
Author: Scott Klement

I tried this and it worked...
openssl base64 -in /path/to/file.in -out /path/to/encoded/file.base64

Bryan


Jorge Merino said the following on 4/11/2012 1:49 PM:
Hi,

I want to encode a TIF image stored on the IFS and to embed it into an XML document that will be downloaded on a web browser.

I know that by open() the IFS file, then QDCXLATE(), and base64_encode() -of course using Scott's tools- do the magic, but has to be by reading in a loop the buffer returned by open().

However, I want to save some extra programming by avoiding the loop and convert the full streamed file in one single step (I'm already using CGIDEV2-LoadStreamFile that returns the streamed file).

I found that I can use 'iconv' API from QTQICONV service program to do this conversion, does somebody can share an example of parameters to be used for 'iconv'?.

Thanks you all.

-Jorge

--
This is the RPG programming on the IBM i / System i (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.


This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 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].