XML File Download by php , Cakephp :Source Code

 <?php

 

        $FileName = 'yourfile.xml';   

 

        $Path = WWW_ROOT.'files'.DS.'ctscan'.DS;    

     
        header('Content-Type: text/xml');


        header("Content-Length: " . filesize($Path.$FileName));


        header("Content-Disposition: attachment; filename=$FileName");      

     
        readfile($Path.$FileName); 

 

?>



Tags : cakephp,  xml,  php,