src/Http/Models/En_HttpResponse.php
public function sendFile($file, $name=NULL, $contentType='application/octet-stream', $contentDisposition='attachment'){
        if($name == NULL){
            $name= basename($file);
        }
        header('Content-Description: File Transfer');
        header('Content-Type: '.$contentType);
        header('Content-Disposition: '.$contentDisposition.'; filename="'.$name.'"');
        header('Pragma: public');
        header('Content-Length: ' . filesize($file));
        readfile($file);        
    }
public function sendFile($file, $name=NULL, $contentType='application/octet-stream', $contentDisposition='attachment'){
        if($name == NULL){
            $name= basename($file);
        }
        header('Content-Description: File Transfer');
        header('Content-Type: '.$contentType);
        header('Content-Disposition: '.$contentDisposition.'; filename="'.$name.'"');
        header('Pragma: public');
        header('Content-Length: ' . filesize($file));
        readfile($file);        
    }
public function sendFile ( $ file , $ name = NULL , $ contentType = 'application/octet-stream' , $ contentDisposition = 'attachment' ) { if ( $ name == NULL ) { $ name = basename ( $ file ) ; } header ( 'Content-Description: File Transfer' ) ; header ( 'Content-Type: ' . $ contentType ) ; header ( 'Content-Disposition: ' . $ contentDisposition . '; filename="' . $ name . '"' ) ; header ( 'Pragma: public' ) ; header ( 'Content-Length: ' . filesize ( $ file ) ) ; readfile ( $ file ) ; }
Envia un archivo como respuesta. Se indican distintos parametros del header
@param string $file
@param string $name
@param string $contentType
@param string $contentDisposition
Envia un archivo como respuesta . Se indican distintos parametros del header