Chris wrote:
If this is not the right place to post, please someone direct me to the
correct place.
I'm having problems extracting the binary data that's included in an xml
response back from a server. It's an embedded PDF file that's been base64
encoded. I've got it narrowed down to to a single node using
Msxml2.DOMDocument.4.0 and selectSingleNode but how do I get the data from
there to a PDF file and get the browser to display it.
Can someone kick me in the right direction? I've done all kinds of Google
searches but can't seem to find the right combination of words. A hint (or
heck, some ASP code - not ASP.NET) would be greatly appreciated.
Thanks very much,
Chris
I am a complete amateur at all of this, but offer the following
thoughts:-
1. If you want to extract the binary from the node client side then
you may need to ask at the comp.lang.javascript or
microsoft.public.scripting.jscript / vbscript. However this is not
natively possible to do. Neither JavaScript/JScript nor VBScript have
native binary file handling AFAIK. It is possible to save binary data
to disk using the ActiveX Scripting.FileSystemObject provided you know
what code-page your client is using, or by using the ADODB.Stream
ActiveX object (if it is enabled), security permissions allowing. But
then you will need to run the file, which may need the Windows Script
Host (WSH), or alternatively you could try specifying the save file
path as the URI for a pop-up or IFRAME.
2. The alternative may be to open an IFRAME, point it to the ASP
page, and have the ASP page return pure binary with a response header
setting a content-type to the appropriate PDF description.
3. The third alternative is to save the PDF as a temporary file on
the server, and again, as per 2, open an IFRAME or pop-up window, with
the URI pointing to the temporary file.
I could be way off the mark with all of this, but that is what I would
try.
Regards
Julian Turner
2. Instead of returning an XML, the alternative may be