Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Determining if a download fails or when successful

 
Al Gettier
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to download 100 MB files via HTTP.

I would like to make a Ajax call if either the download fails or when it is successful.

Any ideas?
 
Divya Guttikonda
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes..you can do that easily using AJAX or DWR framework.You can determine whether the files are downloaded or not in the call back function the AJAX provides.There are lots of examples in the net.Recently i implemented one.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Um, Ajax does not download file to the user's computer and JavaScript has no clue if a file actually made it to the client since it has no IO capabilities.

If you are talking about just displaying a large file in the browser which is text, than you can use Ajax.

Eric
 
Al Gettier
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to download a non-html or non-displayable file.

I was thinking maybe a subwindow and attaching javascript to the onreadystatechange of that subwindow's document for IE or a listener on the "DOMContentLoaded" for that subwindow for Firefox.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic