What's wrong with Xsendfile in Yii
Posted
by
petwho
on Stack Overflow
See other posts from Stack Overflow
or by petwho
Published on 2012-09-04T08:25:40Z
Indexed on
2012/09/04
9:38 UTC
Read the original article
Hit count: 220
yii
I have been trying Xsendfile() method in Yii over 20 times and none of them gave me a result. Here is my code:
$file_path = "D:/xampp/htdocs/mywebapp/protected/modules/file_upload".DS.
'views'.DS.'upload'.DS.testfile.".pdf";
Yii::app()->request->xSendFile($file_path ,array(
'saveName'=>$result['gen_name'] .".pdf",
'mimeType'=>'application/pdf',
'terminate'=>true,
));
And despite changing the location of testfile.pdf everywhere on my hard drive, none of them works. I am nearly exhausted with this method. Anyone could help me from being headache? I am using windows and xampp 1.7.4. Thanks so much!
© Stack Overflow or respective owner