Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个链接包含,例如:
<a id="clickLink" href="http://data.sinhvienit.net/2012/T12/img/SinhVienIT.Net---1302911-9xnacom29112012-11.jpg">download</a>
我想在单击链接时下载此文件,而不是打开新标签并显示图像。怎么做?
这将需要从服务器发送一个 Content-Disposition 标头。 Chrome 还支持锚点上的下载属性,但目前在其他浏览器上有一个等效的客户端解决方案。