ahmed201
(Rifajas)
1
sendFile does not work in server but works locally in my system… it send the file with the name of the file as its content help me what’s wrong here?
i use this code in controller
public function actionDownload($id)
{
$music=$this->loadModel($id);
Yii::app()->request->sendFile($music->song,$music->path.$music->song);
}
konapaz
(Konapaz)
3
check if $music->path.$music->song is the correct path
Try also
Yii::app()->request->sendFile($music->song,$music->path.$music->song,'application/octet-stream');
ahmed201
(Rifajas)
4
hi guys now I got it we have to use like this
Yii :: app()-> request-> sendFile ( $music -> song , @file_get_contents($music -> path . $music -> song ));
ahmed201
(Rifajas)
5
thanks for ur reply just now I got it… by using file_get_contents