Pages: [1]   Go Down
Send this topic | Print
Author Topic: TIP: Embeding images in html [Prevent Hotlinking]  (Read 1389 times)
Mop (Gb)
Loyal 110MB Member
*******
Online Online

Posts: 4297


Don't Panic!


WWW
« on: November 28, 2006, 12:32:59 AM »

Embeding images in html files.

Go to: http://www.motobit.com/util/base64-decoder-encoder.asp
and use the 'select a file to convert to a base64 string.' then hit 'Convert the source data'.

Once the page loads, you will get a bunch of gibberish in the text box. On your html page, put:

Code:
<image src="data:image/jpg;base64,CODE FROM ABOVE">

Be sure to replace 'jpg' in the above code with the original format of the image! (bmp, gif, png, etc)

Example: http://mop.110mb.com/test.htm

Why is this usefull? If you embed images on your site, people cannot hotlink to your image on their site! (Make the image appear on their site but its hosted off your site). Saves your bandwith Smiley
« Last Edit: November 29, 2006, 12:13:32 AM by Gb » Logged




Support conficker! Add dino to your sig!
madkatz
Member
*
Offline Offline

Posts: 3


« Reply #1 on: March 10, 2007, 12:32:54 AM »

The only problem I see with this method is that it you want to go threw and edit your HTML by hand it makes it nearly imposable to tell the difference between Images and it makes it extremely long. sad
Logged
inp o҉rtb
The Gangsta
Global Moderator
Official 110mb Guru
*****
Offline Offline

Posts: 15639


experimental theologian


WWW
« Reply #2 on: April 15, 2007, 05:52:19 PM »

... but it makes it handy for when you want to distribute everything as just one html file (you can zip everything up, but it's not nearly as portable)...

however, i don't believe internet explorer supports base64 encoded image strings. you can always use javascript and css, detect ie, and make the server decode the image.
« Last Edit: April 15, 2007, 05:55:20 PM by inportb() » Logged

Hi! I’m a signature virus! Add me to your signature to help me spread.
spam me: ispamspot@gmail.com

blog | my work @ deviantART | Imagine-ng image editor
Pages: [1]   Go Up
Send this topic | Print
Jump to: