javascript - File download complete callback - Stack Overflow

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

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

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

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

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

Share Improve this question edited Aug 18, 2012 at 16:48 Ry- 226k56 gold badges493 silver badges499 bronze badges asked Aug 18, 2012 at 16:18 RandomblueRandomblue 116k150 gold badges363 silver badges558 bronze badges 9
  • Whether it's possibly possible depends on a couple of things, but it's probably not possible purely on the client side. You can keep track of what's been sent on the server side, though, and fetch that periodically. – Ry- Commented Aug 18, 2012 at 16:20
  • I'm my setup there is no server :0 I'm downloading a local file. – Randomblue Commented Aug 18, 2012 at 16:21
  • 3 There is no server? Where does the file that the client is downloading ing from then? Where is the file hosting your javascript code ing from then? The clouds? AFAIK without the aid of a server what you are trying to achieve is not possible. – Darin Dimitrov Commented Aug 18, 2012 at 16:25
  • Why would you download a local file? Anyway, that should be near enough instant. – Ry- Commented Aug 18, 2012 at 16:27
  • 3 @DarinDimitrov: I've found a bug in Chrome that allows me to craft a "file" locally and force Chrome to download it to the downloads folder. I just want to know once the payload has been downloaded. – Randomblue Commented Aug 18, 2012 at 16:28
 |  Show 4 more ments

1 Answer 1

Reset to default 2

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:

Hide image using Javascript after controller action is plete MVC3

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745223666a4617361.html

相关推荐

  • javascript - File download complete callback - Stack Overflow

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

    10小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信