scratch – Rev 51
?pathlinks?
<?php
###########################################################################
## Copyright (C) Wizardry and Steamworks 2017 - License: GNU GPLv3 ##
###########################################################################
require_once('inc/pseudocrypt.php');
require_once('inc/functions.php');
require_once('config.php');
if (!isset($_GET['o']) or empty($_GET['o'])) {
http_response_code(404);
return;
}
$file = array_shift(
preg_grep(
"/$_GET[o]/",
scandir($STORE_FOLDER)
)
);
if(!isset($file) or empty($file))
return;
$finfo = finfo_open(FILEINFO_MIME_TYPE);
header('Content-type: '.finfo_file($finfo, $STORE_FOLDER.'/'.$file));
finfo_close($finfo);
header('Content-length: '.filesize($STORE_FOLDER.'/'.$file));
header('Content-Disposition: inline; filename="' . basename($STORE_FOLDER.'/'.$file) . '"');
header('X-Sendfile: '.$STORE_FOLDER.'/'.$file);