1

we will have large files (up to 2 Gb) files on a web page, and want to have the functionality that the user can continue a download if it gets interrupted.

At the moment, the only solution i can come up with is a java applet, i have tried searching for any existing open source projects with this functionality but havent found any so far.

Would be thankful for any tips how to achieve this, or pointers to existing projects or documentation that can be useful.

I am open to any solutions, so it does not have to be java applet (important is that it works in the most common browsers)

JohnSmith
  • 4,538
  • 9
  • 25
  • 25
  • to clarify: i want it to be all in the browser (i.e. no download manager on client computer) what i had in mind was some applet that handles the download: the applet shows a "save as" window and if the user chooses an existing file, the user will be asked if the download should overwrite or append to the file. when the user choses "append", the applet will check the size of that file (and simply assume its the same file) and continue download what is missing. – JohnSmith Feb 20 '11 at 15:38
  • You stated in your original question that you didn't want to have to use an applet. Now you're saying that you think it's an applet. If you want an applet, then write one--although it would probably have to be signed if you want it to be able to write to the user's hard drive. – Willis Blackburn Feb 23 '11 at 12:52
  • i am looking for alternatives, and applet seem to be the only thing that comes to mind, but i am open to any technologies that does the job and supports most browsers. e.g. in ideal world a jquery plugin that does this would be excellent (but afaik its not possible) – JohnSmith Mar 06 '11 at 23:06
  • Try this servlet: http://balusc.blogspot.fr/2009/02/fileservlet-supporting-resume-and.html – AndrewBourgeois May 30 '12 at 14:40

2 Answers2

0
What you need is a Java Download Manager 


1. An open Source project exist in google 
    http://code.google.com/p/jdownloadmon/
    HTTPDownloadConnection.java#method connect 
2. What partial content range types this server supports    
     Accept-Ranges: bytes
     http://en.wikipedia.org/wiki/List_of_HTTP_header_field
    Accept Range will allow the user to pause and resume download.        
3.http://stackoverflow.com/questions/3414438/java-resume-download-in-urlconnection
Dead Programmer
  • 12,427
  • 23
  • 80
  • 112
  • Funny, that's my old program I created for school. I wouldn't recommend it :P Hilarious to see it on SO though! Haha. – vakio Oct 01 '16 at 11:16
0

You could serve it as a torrent instead of a simple file and let the user's BitTorrent client figure it out.

Assuming you don't want to do that, HTTP lets the client specify a range of bytes to download. The user's browser has to be able to recognize that the file the user wants to download is the same as the one that already exists in partial form and send the proper range headers to the server, and server has to honor them. You can probably take care of the server side, but the browser will have to hold up its end. Some "download manager" programs do this too.

For more information:

http://www.west-wind.com/Weblog/posts/244.aspx

Willis Blackburn
  • 8,068
  • 19
  • 36