Answer the question
In order to leave comments, you need to log in
Why are the headers not overwritten?
Actually, here is the code of the controller, I think it will be clear
public function actionView($id)
{
Yii::$app->response->headers->set('Content-Type','application/pdf');
$documentSave=$this->findModel($id);
return $this->documentService->getPDF($documentSave->documents_id,$documentSave->order,$documentSave);
}
Content-type 'text/html; charset=UTF-8'
header('Content-Type: application/pdf');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question