Vanilla 1.1.2 is a product of Lussumo. More Information: Documentation, Community Support.
1 à 5 sur 5
<?PHP
define("cROOT",dirname(__FILE__)."/../admin/");
require_once(cROOT."library/Core.php");
$core = new Core("../admin/");
if (!$core->gGet('id'))
exit;
require_once(cROOT."library/System.PhotoManager.php");
$photo = new Photo($core);
$photo->setInfo("id",$core->gGet('id'));
if ($photo->load()) {
$rpathimage=realpath(cROOT."../".$core->config['photos']."large/".$photo->getInfo('url'));
header("Cache-Control: max-age=60");
header("Cache-Control: private");
header("Content-Description: File Transfer");
header("Content-Type: application/force-download");
header('Content-Disposition: attachment; filename='.$photo->getInfo('url'));
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($rpathimage));
@set_time_limit(0);
$fp = @fopen($rpathimage, "rb");
set_magic_quotes_runtime(0);
$chunksize = 1*(512*1024); // how many bytes per chunk
while($fp && !feof($fp)) {
$buffer = fread($fp, $chunksize);
print $buffer;
flush();
sleep(1);
}
set_magic_quotes_runtime(get_magic_quotes_gpc());
fclose($fp);
}
?>
1 à 5 sur 5