fix

parent 7023157c
...@@ -115,12 +115,15 @@ class BidAdminController extends AdminController ...@@ -115,12 +115,15 @@ class BidAdminController extends AdminController
$model = BidFile::findOne($id); $model = BidFile::findOne($id);
if($model) { if($model) {
$path = BidFile::path() . $model->filename;
if(file_exists($path)) {
return Yii::$app->response->sendFile(BidFile::path() . $model->filename, $model->filename); return Yii::$app->response->sendFile(BidFile::path() . $model->filename, $model->filename);
} else {
throw new NotFoundHttpException('The requested page does not exist.');
} }
} }
throw new NotFoundHttpException('The requested page does not exist.');
}
/** /**
* Finds the Bid model based on its primary key value. * Finds the Bid model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown. * If the model is not found, a 404 HTTP exception will be thrown.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment