advanced code snippet search
dexter on 01/14/11
1 person have marked this snippet as a favorite
<?php $img_src = "kep.jpg";$imgbinary = fread(fopen($img_src, "r"), filesize($img_src));$img_str = base64_encode($imgbinary);echo '<img src="data:image/jpg;base64,'.$img_str.'" />'; ?>
Report this snippet
This is cool, it encrypts your image name.
But when to use this, I mean where & why people prefer base64 encoding for images?
I just want to know the reasons so that I can decide that I need to use it for my website or not.
The encoded image displayed, but it will not be downloaded, no security reasons
other way it encrypts your img src, not name
You need to login to post a comment.