使用ExtJ设置文件下载目的地 [英] Set file download destination using ExtJs

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

问题描述

我正在使用ExtJs进行前端开发,我正在寻找一种设置要下载的文件的目的地的方法。我知道我可以使用 xtype:filefield 来浏览文件,但这需要我选择一个实际的文件,我只需要为文件目的地选择一个文件夹,然后发送路径其他地方我可以这样做吗?

I am using ExtJs for front end development and I am looking for a way to set the destination for a file to be downloaded. I know I can use xtype:filefield to browse files, but that requires me to select an actual file, I just need to select a folder for the file destination and then send that path elsewhere. Any way I can do that?

推荐答案

您将无法使用javascript选择用户的下载位置。这只能从用户的最终设置,否则会违反用户的安全性。

You will not be able to choose the user's download location with javascript. This can only be set from the user's end, otherwise it would violate user's security.

如果您的应用仅适用于Intranet,您可以通过各种方式将配置推送到用户的浏览器(取决于它们在内部网中运行的Web浏览器)。但是这将使全部下载到该位置。

If your app is for an intranet only there are various ways you can push a config onto the user's browsers (depending on which web browser they are running in the intranet). But that would make ALL downloads go to that location.

大多数浏览器还具有允许用户为每次下载定义位置的配置如此处这里有不同浏览器的更多细节。用户将能够(并且必须)为每次下载选择下载位置。

Most browsers also have a configuration that allow the user to define a location for every download as covered here and here's more specifics for different browsers. The user would be able to (and have to) select the download location for every download.

如果是Intranet应用程序,如果您的Intranet正在运行Firefox,还有此附加组件。您必须将其推送到所有用户的计算机(或手动安装在所有的计算机上)。我还没有尝试过,但是我正在计划使用它,如果你出现这种情况(我所有的ExtJS工作都是用于运行Firefox的内部网) - 每当用户登录到网络时,我都会使用登录脚本推出这样的东西自动安装)。

If this is for an intranet app, and if your intranet is running Firefox, there is also this add-on. You would have to push it out to all your user's computers (or manually install it on them all). I haven't tried it yet but I was planning on using it should a situation like yours arise (all my ExtJS work is for an intranet running Firefox - I push out things like this using a logon script whenever a user logs into the network to automatically install them).

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

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