Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: decoding base64 data on client/browser?

From: "Anthony Jones" <Ant@------------.--->
To: NULL
Date: 3/7/2006 12:45:00 PM
> Just to start a list of reasons why one would want to do what I'm doing:
> 1.  The bandwidth of base64 encoding is significantly less than the
> bandwidth of HTTP encoding -- which can be significant when the files
>grow.

Rubbish.  HTTP does do any encoding.  The file can be sent raw with no
encoding.  In fact in some cases GZip can be used transparently to the
client.
OTH, base64 incurs a 33% bandwidth overhead.

> 2.  One might want to receive metadata along with the file, so JavaScript
> can perform additional tasks based on that metadata.

That's fine.  Can this be done with one roundtrip to get the metadata and
the other to get the raw file data?

> 3.  One might want to download 20 files instead of just one.

Anything wrong with making 20 round trips?

> 4.  One might want to query for information, including binary data,
without
> causing a browser refresh.

Fair enough use XMLHTTP 20 times.

> 5.  One might need a multi-step handshake to take place, and that
>handshake might include binary data.

Now that makes sense. Base64 encoded hash codes.  I've used those but at the
client end it's actually easier to treat them as strings. However there may
be other uses where a byte array would be more useful.

> 6.  One might want to send multiple files -- or binary data blobs -- and
not
> have an HTTP file receive object at the server

Not quite sure what this means.

>
> "Peter Flynn" wrote:
>
> > Brandon wrote:
> > > Does this mean you have no information that can help with the issue
actually
> > > at hand?  Or, are you suggesting that I don't base64 encode the file
before
> > > sending it, and just send the binary file "as is?"  The reason is, an
XML
> > > field cannot contain bindary data.  You have to assume that a binary
> > > combination will occur that will cause the XML to appear malformed.
> > >
> > > Thanks Peter!  Please let me know if you have any suggestions.
> >
> > Sorry, I phrased that ambiguously. I meant why send it as XML at all.
> > If I click on a link to an image, I don't expect an XML file back with
> > an embedded image: I expect the binary image data sent as image/gif or
> > image/jpg or whatever. I don't see why it needs to be encapsulated in
> > XML.
> >
> > ///Peter
> >
> > > -b
> > >
> > > "Peter Flynn" wrote:
> > >
> > >> Brandon wrote:
> > >>> My browser app sends a request to the server for a binary file.  The
server
> > >>> receives the request, converts the file to base64, packages it up in
XML, and
> > >>> returns it to the client/browser.
> > >> Is there a reason for doing this? Why not just send the binary file
as-is?
> > >>
> > >> ///Peter
> > >> -- 
> > >> XML FAQ: http://xml.silmaril.ie/
> > >>
> >




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent