如何在 Internet Explorer 中开始自动下载文件? [英] How to start automatic download of a file in Internet Explorer?
问题描述
如何在 Internet Explorer 中初始化文件的自动下载?
How do I initialize an automatic download of a file in Internet Explorer?
例如,在下载页面中,我希望出现下载链接和一条消息:如果您下载没有自动开始......等".下载应在页面加载后不久开始.
For example, in the download page, I want the download link to appear and a message: "If you download doesn't start automatically .... etc". The download should begin shortly after the page loads.
在 Firefox 中这很容易,您只需要在标题中包含一个元标记, 其中 n 是秒数和
url
是下载 URL.这在 Internet Explorer 中不起作用.如何在 Internet Explorer 浏览器中实现此功能?
In Firefox this is easy, you just need to include a meta tag in the header, <meta http-equiv="Refresh" content="n;url">
where n is the number of seconds and url
is the download URL. This does not work in Internet Explorer. How do I make this work in Internet Explorer browsers?
推荐答案
SourceForge 使用
SourceForgecode><iframe> 元素,其中 src=""
属性指向要下载的文件.
SourceForge uses an <iframe>
element with the src=""
attribute pointing to the file to download.
<iframe width="1" height="1" frameborder="0" src="[File location]"></iframe>
(副作用:没有重定向,没有 JavaScript,原始 URL 保持不变.)
(Side effect: no redirect, no JavaScript, original URL remains unchanged.)
这篇关于如何在 Internet Explorer 中开始自动下载文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!