37 lines
828 B
PHP
37 lines
828 B
PHP
<?php
|
|
if ( !isset( $_SESSION ['ready'] ) )
|
|
{
|
|
session_start ();
|
|
$_SESSION ['ready'] = TRUE;
|
|
}
|
|
|
|
|
|
if (!empty($_GET['rep']))
|
|
$file_location = $_GET['rep'];
|
|
else
|
|
$file_location = '';
|
|
if (!empty($_GET['nom']))
|
|
$file =$_GET['nom'];
|
|
else
|
|
$file = '';
|
|
|
|
$file = str_replace(' ', '+', $_GET['nom']);
|
|
$file_location2=$_SERVER["DOCUMENT_ROOT"].'/upload/'. $file_location.'/'. $file;
|
|
|
|
|
|
|
|
|
|
if (file_exists($file_location2)) {
|
|
header('Content-Description: File Transfer');
|
|
header('Content-Type: application/octet-stream');
|
|
header('Content-Disposition: attachment; filename="'.basename($file).'"');
|
|
header('Expires: 0');
|
|
header('Cache-Control: must-revalidate');
|
|
header('Pragma: public');
|
|
header('Content-Length: ' . filesize($file_location2));
|
|
readfile($file_location2);
|
|
exit;
|
|
}
|
|
?>
|
|
|