我项目中的图像来自外部服务器;我想在单击下载按钮或标签时下载它们,但在另一页中打开它们。
@foreach($items as $item)
<div class="col-lg-2 col-md-4 col-sm-6 nopad image-gallery">
<a target="_blank" class="fancybox mediaReportItem persianNum downloadImg" rel="fancybox-button"
downloadpath="{{ $mediaAddress. '/' .$item->image->original_path }}" id="{{ $item->id }}"
href="{{ $mediaAddress. '/' .$item->image->original_path }}" title="{{ $item->title }}">
<img src="{{ $mediaAddress. '/' .$item->image->thumb_path }}" class="photoThumbnaill"
alt="{{ $item->title }}" download></a>
</div>
@endforeach
下载不起作用,因为图像在外部服务器上。
response()->download($file);