Re: Read Base64 string to write a .gif (or other content type)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello James,

Thanks... I guess I should have been more specific. I have that part, converting the string to a byte array. But for images, I've noticed that there's a header at the start of the file (appears to be just plain text, but not sure)... for example a gif has GIF[version] at the start of the file.

I've tried writing out "GIF89a" at the start and then the byte array, but that didn't work. Then I tried writing the GIF89a to a separate byte array, write that out and then write the data stream byte array... but that didn't work. I've seen some examples in this NNTP about using the BinaryWriter, and comments by Jon Skeet how that's not necessary, but having a hard time finding a single example of how to write this out on your own.

I'm not only interested in writing out GIF's, but also BMPs, JPEG, PNGs, ZIPs, DOCs, XLSs, etc...

Ideas?

--
-AC [MVP MCMS]
http://www.andrewconnell.com
http://www.andrewconnell.com/mvp

How 'bout System.Convert.FromBase64String ()

Home: www.noveltheory.com       Work: www.njtheater.com Blog:
www.honestillusion.com  Day Job: www.partsearch.com "AC [MVP MCMS]"
<swamplander@xxxxxxxxx> wrote in message
news:9c8265c7295518c7ba66586abce1@xxxxxxxxxxxxxxxxxxxxxxx

Any pointers on how to (1) read a Base64 encoded string from a text
file and (2) write it to a binary file?

I have a ton of files that are being generated from a legacy system.
Each file contains a (1) content type one one line, a (2) filename,
and (3) the encoding type (seems to always be Base64, followed by the
encoded string. A process will be to read the content type and
filename, then create a new binary file and write out the converted
base64 string.

Ideas?

--
-AC [MVP MCMS]
http://www.andrewconnell.com
http://www.andrewconnell.com/mvp


.



Relevant Pages

  • Help in French|Spanish|German translation.
    ... I am also an author of User-defined string functions. ... WORDTRANEX (cSearched, cArExpressionSought | cExpressionSough, ... each string of the array is searched ... If the parameter nArStartOccurrence is -1 or omitted, the replacement starts ...
    (microsoft.public.fox.helpwanted)
  • Re: passing a string to a dll
    ... Joe, I really appreciate you taking the time to demonstrate this. ... sure how I would implement indexing it for random alphanumeric codes. ... I might handle the array. ... I actually have been wondering if I could use a second string ...
    (microsoft.public.vc.mfc)
  • Re: passing a string to a dll
    ... I might handle the array. ... I actually have been wondering if I could use a second string ... look at insertion cost, organization cost, and search cost. ...
    (microsoft.public.vc.mfc)
  • RE: Structure conversion from C++ to VB-2008?
    ... One of the most important structures is AmiVar structure. ... point number, the array of floating point numbers, a string or IDispatch ... Dim 13012679 as Integer ...
    (microsoft.public.dotnet.languages.vb)
  • Structure conversion from C++ to VB-2008?
    ... One of the most important structures is AmiVar structure. ... point number, the array of floating point numbers, a string or IDispatch ... Dim 13012679 as Integer ...
    (microsoft.public.dotnet.languages.vb)