xsendfile - above directory

I want to use x-sendfile to get PDF file.




$path = Yii::app()->params['pdfStorage'].$filename;

								

Yii::app()->request->xSendFile($path,array(		

	   'saveName'=>$savename,

	   'mimeType'=>'application/pdf',

	   'terminate'=>false,

));



When pdfStorage is somewhere inside protected directory, xsendfile works.

However, when pdfStorate is above protected directory, I got "The requested URL /index.php was not found on this server." If I put folder with files into protected directory, then it works fine.

How to solve it?

What is the resulting value of $path?

Note that xSendFile needs a full path to the file you want to send, for example

on linux: /srv/www/htdocs/filename

on windows c:\www\filename

Not tested…try




$path = Yii::app()->request->basePath.DIRECTORY_SEPARATOR.Yii::app()->params['pdfStorage'].$filename;