强制下载文件 [英] force download of a file

查看:67
本文介绍了强制下载文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我有一个大的pdf文件,如果我创建一个锚链接,

浏览器将尝试打开该文件,这需要相当长的时间。

有没有办法强制浏览器下载文件而不是试试

来打开它?


感谢

解决方案

ron1972< ro ***** @ gmail.com>写道:

您好我有一个大的pdf文件,如果我创建一个锚链接,
浏览器将尝试打开该文件,这需要相当长的时间。有没有办法强制浏览器下载文件而不是尝试打开它?




参见 http://www.htmlhelp.com/faq/html/lin ...强制下载

-

Darin McGrew, mc *** *@stanfordalumni.org http://www.rahul.net/mcgrew /

网页设计组, da***@htmlhelp.com http://www.HTMLHelp.com/


警告:日历中的日期比它们显示的更近。


谢谢〜


< blockquote> ron1972写道:

嗨我有一个大的pdf文件,如果我创建一个锚链接,
浏览器将tr是打开文件,这需要相当长的时间。有没有办法强制浏览器下载文件而不是尝试
打开它?




如果是用户的浏览器配置为默认打开文件,你可以做任何事情,你可以做什么。那是应该的。毕竟,如果它的价格太大而无法打开,那么为什么决定由你自己决定*对于用户来说太大了*

太大了想要下载吗?


礼貌的做法是用

文件的大小来注释链接。如果你想要额外的帮助,你可以建议文件

非常大而用户可能想要下载它 - 对于

例子,选择 ;下载此链接或某些安装中可用的

上下文菜单中的类似命令(也称为右键单击,

,但并非所有网络用户都可以使用)。


Hi I have a large pdf file that if I create an anchor link to, the
browser will try to open the file, which takes quite a long time. Is
there a way to force the browser to download the file rather than try
to open it?

Thankss

解决方案

ron1972 <ro*****@gmail.com> wrote:

Hi I have a large pdf file that if I create an anchor link to, the
browser will try to open the file, which takes quite a long time. Is
there a way to force the browser to download the file rather than try
to open it?



See http://www.htmlhelp.com/faq/html/lin...force-download
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"Warning: Dates in the calendar are closer than they appear."


thanks~


ron1972 wrote:

Hi I have a large pdf file that if I create an anchor link to, the
browser will try to open the file, which takes quite a long time. Is
there a way to force the browser to download the file rather than try
to open it?



If the user''s browser is configured to open the file by default, there''s
nothing you can do about it. That''s as it should be. After all, if it''s
too large to open, why should the decision be up to you that it *isn''t*
too large for the user to want to download at all?

The courteous approach is to annotate the link with the size of the
document. If you want to be extra helpful, you can suggest that the file
is really large and the user may want to download it instead--for
example, by choosing "Download this link" or a similar command from the
context menu available on some installations (a.k.a. "right-clicking",
but that isn''t available to all web users).


这篇关于强制下载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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