File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Determining if a download fails or when successful Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Determining if a download fails or when successful" Watch "Determining if a download fails or when successful" New topic
Author

Determining if a download fails or when successful

Al Gettier
Greenhorn

Joined: Nov 16, 2005
Posts: 8
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

Joined: Mar 09, 2005
Posts: 47
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Nov 16, 2005
Posts: 8
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.
 
GeeCON Prague 2014
 
subject: Determining if a download fails or when successful