Answer the question
In order to leave comments, you need to log in
It is not clear how the image is downloaded?
I have such a problem that when you click on downloading a file, it comes out like this, but it does not download the file, but exits. Error status 206 Partial Content
I have this in my code
<?= DetailView::widget([
'model' => $model,
'attributes' => [
[
'attribute' => 'img',
'format' => 'raw',
'value' => $model->img == null ? null : Html::a($model->img, '@web/attachment/'.$model->img, ['download' => true])
],
[
'attribute' => 'maket',
'format' => 'raw',
'value' => $model->maket == null ? null : Html::a($model->maket, '@web/maket/'.$model->maket, ['download' => true]),
'visible' => $model->maket != null
],
],
]) ?>
Answer the question
In order to leave comments, you need to log in
Judging by the screenshot, your DetailView is wrapped in Pjax, and this is the problem. All links in a container open inside it by default.... add the data-pjax="0" attribute to links to open links outside the container, for example:
Html::a($model->maket, '@web/maket/'.$model->maket, [
'download' => true,
'data-pjax' => 0
])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question