I'm asking for a solution how to make PHP download a file without redirect and without reading file source like in this example:
if(1 == 1)
{
    header("Content-Type: application/xml");
    header("Content-Transfer-Encoding: binary");
    header("Cache-Control: private",false); 
    header("Content-Disposition: attachment; filename=example.xml;" );    
    $file = file_get_contents("file.ext");
    echo file;
}
I need solution for download witout file_get_contents make the download like mod_rewrite.
Thanks
 
     
     
     
    