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


   if (isset($_POST["CoID"])){	
        $CoID=$_POST["CoID"] ;
    }
       if (isset($_POST["Prod_Code"])){	
        $Prod_Code=$_POST["Prod_Code"] ;
    }
    
   
$filename=trim($CoID)."_photos/".$Prod_Code.".jpg";
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);
}
else {
    echo null;
}
?>

