使用Internet Explorer检测文件下载 [英] Detect file download with internet explorer

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

问题描述

我正在寻找一种检测用户何时在Internet Explorer中下载文件事件的方法,但是我还没有找到一种方法,这可能吗?怎么样?

I am looking for a way to detect when user download a file event in internet explorer, but I didn't found a way yet, is it possible at all? how?

推荐答案

您可以尝试使用此线程.

You can try to detect file download in browser using jQuery File Download plugin. For more information, you could refer to this thread.

注意-您还必须在服务器的响应标头中结合使用此插件编写一个cookie

Note - You must also write a cookie in conjunction with using this plugin in the server's response headers

但是由于安全问题,我认为仅靠客户端代码无法实现目标.从浏览器方面,我们无法从浏览器进入文件保存对话框,因为它是操作系统级别.从文件方面,您无权访问服务器中的文件,也不知道文件的状态.您也可以在此主题中引用可接受的答案更多信息.

But I think you can't achieve your goal with only client-side code due to security issues. From the browser side, we can't reach the file save dialog from browser as it's OS level. From the file side, you don't have access to the files in the server and you don't know the states of the files. You could also refer to the accepted answer in this thread for more information.

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

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