Recover from a HTTPConnection network problem
Hi all,
I'm developping an applet for file downloading using HttpConnection class.
i want to implement the following feature :
In the case of an error occurring due to network problems the
applet must be able reconnect and resume the data transfer without downloading the entire file(s).
well i suspect there is an exception thrown in a network problem but don't know exactly which one..
can someone give some ideas how to do that ?
thanking you much.
If the server supports the partial downloads you can do so.
But I do not remember the exact headers that you use to tell the server the range of bytes that you want.
(When you use FlashGet to download the files form intenet you can see it is sending those headers. )
But if the server does not support the partial download it will send the entire thing.
LRMKa at 2007-7-14 21:56:10 >

use the "Range:" request property in the header.
I think you use HttpConnection u; u.setRequestProperty( "Range", "bytes=5000-" );
this is an example (check the class names, etc) to start the transfer 5000 bytes thru the file.
you must say "bytes=" and you must place the "-" at the end.
The full details are availble in one of those rfc documents on the GET method.