<?php

$profile_data = '';
if(isset($_REQUEST['i'])){
$profile_data = $_REQUEST['i'];
}
$pathfile = getcwd();

if(strlen($profile_data)==0){
   $profile_data = 'default.png';
}
$file = $pathfile . '/pdf_data/' .$profile_data;
    
$imageFileType = strtolower(pathinfo($file,PATHINFO_EXTENSION));
/* do file type selsection here */
if($imageFileType == "jpg" ){
    $type = 'image/jpg';
}
if($imageFileType == "png" ){
    $type = 'image/png';
}
if($imageFileType == "jpeg" ){
    $type = 'image/jpeg';
}


header('Content-Type:'.$type);
header('Content-Length: ' . filesize($file));
readfile($file);
exit();


?>