My JavaScript book is out! Don't miss the opportunity to upgrade your beginner or average dev skills.

Tuesday, July 05, 2011

Online Base 64 Converter

Update apparently I am more than late since datauri.com does similar stuff ... oh well, better two options than nothing, right? Thanks @mathias for the update.


Right, you may think this is the most useless thing ever but actually embedded content is freaking cool and this is the reason I have created a truly simple page in 3site.eu/base64.

What The Hack Is That

Nothing truly special, you choose a file, you get its representation in base64 compatible with inline data url.

Best Available Option

... is converting data accordingly with your browser: who better than a browser can know how to understand inline data? Chrome or any other HTML5 Enabled Browser should work offline without problems, but if you are masochist and stubborn, it may fallback into server side encoding. Latter case may be dropped as soon as my cheap space in my cheap website will suffer too many requests so ... did I say already use a decent browser?
And that's all folks :)

2 comments:

Arty V said...

Check http://chikuyonok.ru/data-url/

J said...

I've made something similar, though it's server side only:

http://tools.sandboxx.org/custom_anything.php

the script can also take an gzipped, then base64* encoded string as argument, plus a mimetype, decode/unpack it and send it back:

click me

sure, that defeats the purpose of putting something "inline", because it still requires a request :P oh well, just a silly idea I thought I'd share :)


* (that is, base64 with a few chars replaced to make it URL safe, obviously)