Skip to content

Instantly share code, notes, and snippets.

@roelven
Created June 16, 2011 16:24
Show Gist options
  • Save roelven/1029623 to your computer and use it in GitHub Desktop.
Save roelven/1029623 to your computer and use it in GitHub Desktop.
<?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