target =“_ blank”继续下载图片而不是打开其他页面

The problem when i click the image, the image is downloading instead of opening to other tab.

@foreach($image as $get_image_value)
            <div class="thumbnail">
                <figure>
                    <a href="{{url('/storage/'.$get_image_value->image.'')}}" target="_tab">
                        <img src="{{url('/storage/'.$get_image_value->image.'')}}">
                    </a>
                </figure>
            </div>
    @endforeach

Sample image

Sample image

If the image is downloading then either:

  • The browser is configured to download that file format
  • The server is sending a Content-Disposition: attachment header to tell the browser to download it.
  • The server is sending the wrong Content-Type header for the image.

You can't do anything about the first case.

The second case you will need to find the code or server configuration that is setting that header and change it.

The third case you will need to fix the server configuration so it sends the correct Content-Type. This might be a case of renaming the file so it has the correct file extension.