AlaK4X
Linux lhjmq-records 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64



Your IP : 18.191.171.72


Current Path : /var/www/lhjmq-records.qc.ca/public_html/speedtest/
Upload File :
Current File : /var/www/lhjmq-records.qc.ca/public_html/speedtest/getimage.php

<?php

//Requires a path with filename
function path_extract_filename($path){
	return substr($path, strrpos($path, '/')+1);
}

//Requires a path with filename
function path_extract_path($path){
	return substr($path, 0, strrpos($path, '/')-1);
}

$filepath = "/test1.jpg";

//Check if the content exists already in the nav cache
if(!is_file('../speedtest' . $filepath) || !is_file('../speedtest' . $filepath.'.mime')){
	header('Content-type: text/plain');
	exit('Incorrect specifications');
}

header("Pragma: public");
header("Expires: 0"); // set expiration time
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header('Content-type: ' . file_get_contents('../speedtest'.$filepath.'.mime'));
if($_GET['content'] == 'save'){
	header('Content-Disposition: attachment; filename=' . path_extract_filename($filepath));
}else{
	header('Content-Disposition: inline; filename=' . path_extract_filename($filepath));
}
readfile('../speedtest' . $filepath);
?>