简体   繁体   English

我如何制作一个链接来调用下载对话框,而不是显示该对话框

[英]How can I make a link to invoke the download dialog box rather than it being shown

How can I modify 我该如何修改

<a href="someimage">Download this</a> 

in order to invoke the download dialog box? 为了调用下载对话框?

You could send a 您可以发送一个

Content-disposition: attachment; filename=someimage.jpg

HTTP header. HTTP标头。

Instruct the server to send it with a generic binary MIME type - binary/octet-stream is good for this. 指示服务器使用通用二进制MIME类型发送它-二进制/八位字节流对此很有用。 Standards conforming browsers will then just download it. 然后,符合标准的浏览器将直接下载它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何制作一个标记链接到html文本而不是文件? - How can I make an a tag link to html text rather than a file? 如何在网页上添加机制以将 html 文件下载到他们的移动设备? (链接打开页面而不是下载 html 文件) - How can I add a mechanism on a web page to download an html file to their mobile device? (The link opens page rather than downloading the html file) 如何将文字换成scrollWidth而不是clientWidth? - How can I make text wrap to scrollWidth rather than clientWidth? 如何使这种样式适用于按钮而不是锚? - How can I make this styling work for button rather than an anchor? html网站中的下载链接无法显示对话框 - download link in an html web site can't showing dialog box 如何根据选择框中选择的不同选项来显示不同的图片? - How can I get different pictures being shown depending on the different options being selected in a select box? 如何使对话框覆盖整个屏幕? - How can I make my dialog box cover the whole screen? 如何在滚动时更改链接的整个背景而不仅仅是文本? - How do i make the entire background of the link change when scrolled over rather than just the text? 链接标签打印而不是被解释 - Link tag printing rather than being interpreted 单击该如何下载链接 - how can i make a link download when clicked
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM