How to make Safari and IE download image instead of opening in a new page?

后端 未结 4 1695
庸人自扰
庸人自扰 2020-12-31 02:52

In Firefox and Chrome this link property \"download=img.jpg\" works fine and shows the download window instead of a new tab or page.



        
4条回答
  •  忘掉有多难
    2020-12-31 03:07

    The easiest is to use a Server-side language like PHP. It's really discussed more in depth on this page, including some trial code for manipulating headers and such. Unfortunately, these are the only solutions until IE and Safari catch up.

    Refrence:

    • HTML href image link download on click

提交回复
热议问题