点击链接不在浏览器打开而是弹出下载对话框
Posted sjwudhwhhw
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了点击链接不在浏览器打开而是弹出下载对话框相关的知识,希望对你有一定的参考价值。
怎样点击直接下载
实现点击链接直接下载文件
Microsoft provides a way to override this "stream now" behavior at the server side using a custom HTTP Header in IIS. To add the custom header, launch Internet Information Services Manager and expand your Web sites to reveal the folder where multimedia content is stored. Right-click this folder and choose Properties. Click the HTTP Headers tab, followed by the Add button.
For the Custom header name type: Content-disposition
For the Custom header value type: attachment
Click OK, click Apply, click OK.
Visit one of the Web pages linking to your content download and test the links. You should be presented with the Save As dialog.
There is a catch to this solution. By setting the Content-disposition for the entire folder, your server will pop the Save As dialog box for any file called by a Web browser, including Web pages. There are two ways to solve this problem: only store media files in the folder where you modify the Content-disposition or set the attribute on-the-fly using code.
原文来自:http://www.jakeludington.com/windows_media_server_admin/20041209_using_custom_http_headers_to_prompt_for_video_file_downloads.html
再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!http://www.captainbed.net
以上是关于点击链接不在浏览器打开而是弹出下载对话框的主要内容,如果未能解决你的问题,请参考以下文章
IE浏览器浏览网页时,所有要弹出新窗口的链接点击了都没有用了是怎么回事?