You are here

Single File HTML

9 posts / 0 new
Last post
silentcon
silentcon's picture
Offline
Last seen: 10 years 7 months ago
Joined: 2008-05-31 05:37
Single File HTML

How can you make an single file HTML document without the folder for the pictures etc?

NathanJ79
NathanJ79's picture
Offline
Last seen: 2 years 9 months ago
Joined: 2007-07-31 15:07
Pictures as code

The pictures get converted to hex and are stored in the HTML. Wiki on a Stick (aka StickWiki) does this; google it, unpack the HTML file, and have a look at the code.

You'll need to find a program that converts images to hex code. I have no idea how to do that.

Is that what you were asking?

silentcon
silentcon's picture
Offline
Last seen: 10 years 7 months ago
Joined: 2008-05-31 05:37
yes. I never thought you

yes. I never thought you could do that.

NathanJ79
NathanJ79's picture
Offline
Last seen: 2 years 9 months ago
Joined: 2007-07-31 15:07
Same here

Yeah, neither did I, until I saw it. Here's how StickWiki draws the Save icon:

{img id="img_save" style="display: inline; visibility: visible;" alt="Save" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAAK/INwWK6QAAAAZiS0dEAP8A/wD/oL2nkwAAA0FJREFUeNq1lc+KHFUUxn/n3qqu6h7tGdPByTBOEjQunK26EQRdhAGRuHGE2agLH8C1j5AXCFnkAYyBEIKoRHeabWQyJKIm+IdAdwSd0HZPdVXdc1xU9UynbZIe/xy4XG5R93z3fN937hWqeALYqGcFhH8WBkTAD8DXTCS64n18Jo6ToFo4792hAEQEVUUVc87baDR0ZvYBcEFAngO7eeatD5vHjq2XKysDee/dNxkOc9zcOIJzgXPnrhD0mfDVl+cbt29f/0zEvREBHqD9ZIckWfCdIwnLy8v0+3t47x7PiRkAcexoLy6SZW1arTaAQyq+ACSEAtVAURQyGo3I8/krMANVoSxLQigtaKjKsgkAREAEmRjOzVeBCDgnCPXecU7g8Rn+ZfzvANHkYprxsYD/GYABiExAzS+yWcX/IwEATEu8V7w3vNc5skvVvt7Qyj2zAVSVVqvJj3d6nD37MeAxJimSh+qxuj5DMVNUA7t/wFNHInSC2mhyh6AkyQrd3gOKYhcRv2/V6dOJCBoCjWSJNG2jqiSpAPrQUaLpTXk+4mhnyObma4QAWTZABNJ0AdWDk5mB98bFi9fJ8gWSxBFCybQt/gagqjSbTU6cOMknl66xvd0DjJdfWmNj41WGwwznBFVIU0+z1WQwDMRRNNMUUyJXzIYQyPOMbvcB8DSqSre7S1mOKIoc5xxmRp57NITaebMjmvlVqmq8czingOJ8Zd8DK8pB3ke0y34n26y/qutp8n45dEQ1fPA+qkU0MzMxM4q8JMsCqkpelJgZqoZz4xvU6m6vZqs6bnxYA4hEBDNz/f7vliQtnBuQNBJL0xbr68cpw6+Asf7CsyRJimpFk1klcqOR4HxEVIvsfSzeRQAmApGZfQ9c/uLz81tpupB3Oidd736X7e0dVlc7rK4u1g6LuHXru30NzMA55f5vPfLc0CCEMkgIZTkY7Hog7PebiHNLS8uXKlQpqR5+O+wQEQVCvX6/lrHq+M13PmplWf760c7QnT79Cnt7h3nRFO+Fq1e/saLoRDd3rv10986Nb0WECMTAiOMkWzv+4qfPnyrY2nqb/p97+DletDFdcSz8/EtgNFrj3r0d7nJDRMT+AqKAkRUl/oStAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAABJRU5ErkJggg==" /}

Obviously replace { and } with . Apparently there's no way to post HTML code, and the standard comment code isn't accepted by Drupal's parser, so...

ottosykora
Offline
Last seen: 1 day 16 hours ago
Joined: 2007-10-11 17:48
here you try

This is base64 encoding, so not hex exactly, but rather ascii framing like used in any e-mail client.

There seem to be many websites doing single files on line, for example:

http://www.motobit.com/util/base64-decoder-encoder.asp

http://www.askapache.com/online-tools/base64-image-converter/

But when I was young, (many years ago) I had to do conversion for all e-mail attachments by hand, yes, if the files had to leave compuserve network, we had to ascii frame it by hand first, and we were using prog called wincode for it. OK it is 16bit, but sure there is something more recent for it.

http://www.zdnet.de/windows_mail_wincode_download-39002345-14803-2.htm

Otto Sykora
Basel, Switzerland

crux
Offline
Last seen: 2 years 2 weeks ago
Joined: 2008-06-13 18:10
Did you work for Compuserve?

That was a long time ago...

ottosykora
Offline
Last seen: 1 day 16 hours ago
Joined: 2007-10-11 17:48
no did not work there

but was one of the early users here

I had doscim and then wincim and all the additional gadgets one could download and play with that time. First modem was 2400 only.
You see , I mentioned number of times I am a gruftie, so well that was long time ago. However the compuserve classic with the HMI protocol on the end user side was switched off only last year, I had an account there until the last end of it.

And since Compueserve did use propper 8bit transmission of e-mail and attachments, when we tried to send an e-mail with binary attachment to place outside of compuserve network, we had to convert it to 7bit format first. Sometime people call that ascii framinig or ascii armouring or what ever. We used mostly UU encoder for that, but base64 is very similar and the wincode software does it both. It simply does what every mail client has to do, take 3 bytes (=24 bit) fill it up to 28 with some dummy bits and divide it by 7. You get 4 ascii chars.

Otto Sykora
Basel, Switzerland

Darkbee
Darkbee's picture
Offline
Last seen: 2 years 7 months ago
Joined: 2008-04-14 09:41
Might not support all browsers

I'm not sure if all browsers support embedding images as base64 encodings just so you know.

Last time I checked StickWiki, the icons appeared in Firefox but not Intergnat Exploder. I have no idea about Safari and Opera... and others, and maybe even IE does now. Just thought I'd mention it.

José Pedro Arvela
Offline
Last seen: 3 years 11 months ago
Joined: 2007-07-10 07:29
All but older IEs

First, the data:/ URI scheme can be used for more than base64 encoding. (more about it here)

Gecko based browsers (Firefox/Seamonkey/Flock/etc), Webkit based browsers (Safari/Google Chrome/Arora/etc) and Opera support it surely.

IE 8 is the first of the IE line to support the data:/ URI. IE 7/6/older do not support it. Furthermore, the IE team crippled the data:/ URI for security reasons. (more on the wiki page above)

Blue is everything.

Log in or register to post comments