Download file image png/jpg?

Hello, I have problem with download image from server.

My view

     echo Html::a('<span class=" glyphicon glyphicon-save-file"></span>', ['image/download-file', 'id'=>$model->id_image,],['title'=>'pobierz','data-pjax'=>"0"]);

and controller

    public function actionDownloadFile($id=null)


        $download = image::findOne($id);

         $path = Yii::getAlias('@webroot').'/uploads/'.$download->src;

        if (file_exists($path)) {

            return Yii::$app->response->sendFile($path);



If I try download other format than image, e.g pptx,docx etc I can do it, but if tried png/jpg I can’t. I gets white page… where is error?

Someone can help me?

Is it sending proper content type in headers?

lel, now working… I didn’t do anything with my code. Maybe wrong file or don’t know.