File size: 1.27Kb
<?php
# Script by seg0ro http://mobilarts.ru
# Not for sale!!!
# fixed
if (!$file){
echo Core::msg_show('Отсутствует идентификатор файла!<br /><a href="index.php">Форум</a>');
include H . 'engine/includes/foot.php';
}
$sql->query("UPDATE `forum_files` SET
`down`= down + 1 WHERE `id` = '$file' LIMIT 1 ");
$file = '/forum/files/attach/'.$fileRes['name'];
$ext = array_pop(explode(".", $fileRes['name']));
if ($ext == 'jar' && isset($_GET['jad'])){
include 'includes/fileupload.php';
$filename = str_replace(".jar", "", $fileRes['name']);
$filesize = filesize('../'.$file);
$zip = new PclZip('../'.$file);
$content = $zip->extract(PCLZIP_OPT_BY_NAME,'META-INF/MANIFEST.MF',PCLZIP_OPT_EXTRACT_AS_STRING);
header('Content-type: text/vnd.sun.j2me.app-descriptor');
header('Content-Disposition: attachment; filename="'.basename($filename).'.jad";');
echo $content[0]['content']."\n".'MIDlet-Jar-Size: '.$filesize."\n".'MIDlet-Jar-URL: '.$_SERVER['HTTP_HOST'].'/'.$file."\n".'MIDlet-Delete-Confirm: Файл скачен с сайта '.$_SERVER['HTTP_HOST'];
}
else
{
core::get('downloadfile', 'includes');
DownloadFile(H . $file, $fileRes['name']);
}
//header ('Location: ../'.$file);