[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Looking for best option



Bruce Reynolds wrote:
> 
> From previous email postings I understand that base64 data should not be
> converted to EBCDIC

Why not?  base64_decode() (from BASE64R4) won't understand the data 
unless it's EBCDIC, so I don't understand why you'd say this.

The whole point behind base64 is that you can translate the encoded data 
any way you like.  That's the POINT of base64.  Feel free to translate 
the encoded data to EBCDIC -- it's the DECODED data that you have to be 
careful with.

Therefore I'd do this:

a) Call http_XmlReturnPtr(*ON)
b) Call http_url_post_xml().
c) in your end element handler, check for the BASE64DATA tag.
d) if BASE64DATA, allocate temporary memory for the output from 
base64_decode().
e) if BASE64DATA, call base64_decode()
f) if BASE64DATA, open an IFS file.
e) if BASE64DATA, write decoded data to IFS.
f) if BASE64DATA, close file.
g) if BASE64DATA, deallocate temporary memory.

The result should be your TIFF file.

The other flaw in your logic is that browsers don't usually understand 
TIFF files.  You may need to convert them to PNG or JPG first, then send 
THAT to a browser.  If that turns out to be an issue, you might look 
into imagemagick to see if it can convert your TIFF to another format.

Make sense?  Let me know if you need more info on any of these steps.
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------