Sendfile Does Not Send Right File

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);

	}

help me… ::)

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');

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 ));

thanks for ur reply just now I got it… by using file_get_contents