XML, Base64, VBScript decoding 
Author Message
 XML, Base64, VBScript decoding

Hi,

I recently read the article at :
http://www.*-*-*.com/

which helped me a lot in being able to place a binary file into an XML
document using Base64 encoding.

In my case I am embedding a graphics file. I then have the XML document
posted to an ASP file using VBScript, all the data arrives just fine.

However I cannot figure how to extract the file back to binary format so
that I can write it to disk.

<Image>
        <Filename>my.gif</Filename>
        <Data dt:dt="bin.base64">jHyukNgTrdcvhuUI</Data>
</Image>

This is an indication of what my VBScript/ASP page recieves (Obviously
not a real image in this case) but I wanted to use XMLDom on my web
server to decode this Base64 data back to binary format so I can save it
to the file name my.gif

Anybody give me a clue?

Cheers,
Gary Walker
-- Magwitch --
ICQ# 30214234



Fri, 12 Dec 2003 18:36:06 GMT  
 XML, Base64, VBScript decoding
I ran into the same thing a while ago.  My solution was to write the encoded
image element data to a temp file.  Then I ran it through a DLL that I
created using some C source code [MIME base64 encoder/decoder by Karl Hahn]
that I found on the web.  I created it so that the exported functions of the
DLL take an input filename and an output filename, so to extract your image
you'd do something in your VB code like:

DecodeFile "MyTempFile.tmp", "MyImage.jpg"

If you need help, I can post the C source code or send you the DLL.  There
are probably a lot of better MIME/Base64 implementations out there, but this
one works for me.


Quote:
> Hi,

> I recently read the article at :
> http://support.microsoft.com/support/kb/articles/Q254/3/88.ASP

> which helped me a lot in being able to place a binary file into an XML
> document using Base64 encoding.

> In my case I am embedding a graphics file. I then have the XML document
> posted to an ASP file using VBScript, all the data arrives just fine.

> However I cannot figure how to extract the file back to binary format so
> that I can write it to disk.

> <Image>
>         <Filename>my.gif</Filename>
>         <Data dt:dt="bin.base64">jHyukNgTrdcvhuUI</Data>
> </Image>

> This is an indication of what my VBScript/ASP page recieves (Obviously
> not a real image in this case) but I wanted to use XMLDom on my web
> server to decode this Base64 data back to binary format so I can save it
> to the file name my.gif

> Anybody give me a clue?

> Cheers,
> Gary Walker
> -- Magwitch --
> ICQ# 30214234



Sat, 13 Dec 2003 07:06:42 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. how decode base64 string?

2. Base64 Decode

3. Base64 encoding/decoding

4. Anybody have any code for en/decoding base64?

5. base64 decoding (encoding probably as well)

6. Where can I find BASE64 decoding SOURCE CODE?

7. Base64 Decode

8. Does anyone have code for en/decoding base64?

9. Does anyone have code for en/decoding base64?

10. base64 Encode/Decode

11. Sample Code for Base64 Encoding/Decoding

 

 
Powered by phpBB® Forum Software