<?php
$CoID="";
$FileName="";


   if (isset($_POST["CoID"])){	
        $CoID=$_POST["CoID"] ;
    }
       if (isset($_POST["FileName"])){	
        $FileName=$_POST["FileName"] ;
    }
    
$filename=trim($CoID)."_photos/".$FileName.".jpg";
$data=null;
if (file_exists($filename)) {
    $data = file_get_contents($filename);
    $mime="image/jpg";   
    header('Content-Type: "'.$mime.'"');
    header('Content-Disposition: attachment; filename="'.$filename.'"');
    header("Content-Transfer-Encoding: binary");
    header('Expires: 0');
    header('Pragma: no-cache');
    header("Content-Length: ".strlen($data));
}
exit($data);
?>