Good morning everyone,
i have the following problem,
I have saved some images in the uploads / upload folder
in the view I have a link
echo Html :: a ($ upload, ['download-file', 'nameFile' => $ upload, 'id' => $ message-> thread], ['class' => '', 'target' => '_blank'])
which calls an action which returns the image
public function actionDownloadFile ($ nameFile, $ id = null)
{
....
....
return Yii :: $ app-> response-> sendFile ($ target, $ nameFile);
everything works fine, the problem is that if it is a pdf file, it is correctly opened in a new tab
if instead it is a jpg image, the download starts automatically, but, similar to the pdf, I would like the image to be shown in a new tab
what am I doing wrong?
thank you