文件下载完成回调 [英] File download complete callback

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

问题描述

我希望能够纯粹在客户端跟踪文件下载的进度,特别是文件下载完成情况。

I would like to able to track, purely on the client side, the progress of a file download, especially file download completion.

是否有JavaScript API,允许我在文件下载完成时定义一个回调吗?

Is there a JavaScript API that allows me to define a callback upon file download completion?

推荐答案

不,使用纯javascript是不可能的。虽然涉及使用来自服务器的cookie和来自客户端的连续轮询,但有一些技术。我在这里举了一个例子:

No, this is not possible using pure javascript. There are some techniques though involving using cookies from the server and continuous poll from the client. I've illustrated an example here:


控制器操作完成后使用Javascript隐藏图像MVC3

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

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