影响浏览器下载目标 [英] Influence browser download destination

查看:140
本文介绍了影响浏览器下载目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以影响浏览器下载目录的HTTP下载?这种情况是,我们的一些用户抱怨他们在下载文件时必须点击目录结构。由于我不知道他们的个人喜好,所以最好让浏览器使用最后选择的下载目录。这可能吗?我知道用户可以从大多数浏览器的选项对话框(firefox,chrome等)中选择他们的下载目的地,但是我可以影响服务器端的行为吗?



谢谢,
Mo

解决方案

服务器端,没有。您的浏览器客户端控制首选项/选项中的下载位置(取决于您使用的浏览器)。



但是,您可以通过JavaScript。看看这个控件:



或if您只能使用IE,您可以使用这个:

  document.execCommand(saveas,false,c:\ \ where \\\\\\\\\\\\\\\\\\\\\\\。)))))))))))) 


is there a way to influence the browsers download directory for a given HTTP download? The scenario is that some of our users are complaining that they have to click through the directory structure whenever they download a file. As I don't know their individual preferences, it would be nice to make the browser use the last chosen download directory. Is this possible? I know that users can choose their download destination from within most browsers' options dialog (firefox, chrome, etc.), but can I influence that behavior from the server side?

Thanks, Mo

解决方案

Server side, no. Your browser client controls where to download in the Preferences/Options (depending what browser you are using).

However, you can via JavaScript. Take a look at this control:

or if you are only using IE, you can use this:

document.execCommand("saveas",false,"c:\\where\\yo u\\want\\to\\save\\it\\to.txt");

这篇关于影响浏览器下载目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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