Created
June 16, 2011 16:24
-
-
Save roelven/1029623 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
file: proxy64.php | |
function: convert an image to a base64 string | |
author: Roel van der Ven | |
date: 16.06.2011 | |
*/ | |
$file = $_GET['file']; | |
if ($file) { | |
$wave = base64_encode(file_get_contents($file)); | |
$output = "data:image/png;base64, ".$wave; | |
print $output; | |
} else { | |
header('HTTP/1.0 404 Not Found'); | |
print 'file not found.'; | |
}; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment