如何开始在Internet Explorer中自动下载文件? [英] How to start automatic download of a file in Internet Explorer?

查看:120
本文介绍了如何开始在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中,这很容易,您只需在标头中包含元标记< ; meta http-equiv =Refreshcontent =n; url> 其中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 使用< 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆