public function getFile()
    {
        $variableUri = $_POST["variableUri"];

        $delivery = $this->getResource(tao_helpers_Uri::decode($this->getRequestParameter('deliveryUri')));
        try {
            $this->getResultStorage($delivery);

            $file = $this->getResultsService()->getVariableFile($variableUri);
            header(
                'Set-Cookie: fileDownload=true'
            ); //used by jquery file download to find out the download has been triggered ...
            setcookie("fileDownload", "true", 0, "/");
            header("Content-type: " . $file["mimetype"]);
            if (!isset($file["filename"]) || $file["filename"] == "") {
                header('Content-Disposition: attachment; filename=download');
            } else {
                header('Content-Disposition: attachment; filename=' . $file["filename"]);
            }

            echo $file["data"];
        } catch (\common_exception_Error $e) {
            echo $e->getMessage();
        }
    }
public function getFile()
    {
        $variableUri = $_POST["variableUri"];

        $delivery = $this->getResource(tao_helpers_Uri::decode($this->getRequestParameter('deliveryUri')));
        try {
            $this->getResultStorage($delivery);

            $file = $this->getResultsService()->getVariableFile($variableUri);
            header(
                'Set-Cookie: fileDownload=true'
            ); //used by jquery file download to find out the download has been triggered ...
            setcookie("fileDownload", "true", 0, "/");
            header("Content-type: " . $file["mimetype"]);
            if (!isset($file["filename"]) || $file["filename"] == "") {
                header('Content-Disposition: attachment; filename=download');
            } else {
                header('Content-Disposition: attachment; filename=' . $file["filename"]);
            }

            echo $file["data"];
        } catch (\common_exception_Error $e) {
            echo $e->getMessage();
        }
    }
public function getFile ( ) { $ variableUri = $ _POST [ "variableUri" ] ; $ delivery = $ this -> getResource ( tao_helpers_Uri :: decode ( $ this -> getRequestParameter ( 'deliveryUri' ) ) ) ; try { $ this -> getResultStorage ( $ delivery ) ; $ file = $ this -> getResultsService ( ) -> getVariableFile ( $ variableUri ) ; header ( 'Set-Cookie: fileDownload=true' ) ; //used by jquery file download to find out the download has been triggered ... setcookie ( "fileDownload" , "true" , 0 , "/" ) ; header ( "Content-type: " . $ file [ "mimetype" ] ) ; if ( ! isset ( $ file [ "filename" ] ) || $ file [ "filename" ] == "" ) { header ( 'Content-Disposition: attachment; filename=download' ) ; } else { header ( 'Content-Disposition: attachment; filename=' . $ file [ "filename" ] ) ; } echo $ file [ "data" ] ; } catch ( \ common_exception_Error $ e ) { echo $ e -> getMessage ( ) ; } }
Get the data for the file in the response and allow user to download it
Get the data for the file in the response and allow user to download it