Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.
function plogger_download_button() {
global $config;
$id = $GLOBALS["plogger_id"];
if ($GLOBALS['plogger_level'] == "picture") {
return '<a class="download" href="'.$config['gallery_url'].'download.php?image='.SmartStripSlashes($GLOBALS["current_picture"]["path"]).'" title="Download">Download</a>';
}
}
<?
if(!isset($_GET['image']))
{
echo "Nothing to see here. <br />";
exit;
}
$file = 'images/'.$_GET['image'];
$file = str_replace("../","",$file);
if (file_exists($file))
$path_parts = pathinfo($file);
if (isset($path_parts['extension']) )
$ext = $path_parts['extension'];
else
$ext='';
#allow only images for download
if(!in_array(strtolower($ext),array("jpg","gif","png","bmp","jpeg"))) exit;
header("Content-type: application/$ext");
header("Content-Transfer-Encoding: Binary");
header("Content-length: ".filesize($file));
header("Content-disposition: attachment; filename=\"".basename($file)."\"");
readfile ("$file");
?>
1 to 3 of 3