Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Help with download large file (~50mb) from http protocol

843790Mar 12 2010 — edited Mar 12 2010
I'm just using the default HttpURLConnection to download a large file from a server, I can never finish downloading before I get this exception:
java.net.SocketException: Connection reset
	at java.net.SocketInputStream.read(SocketInputStream.java:168)
	at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
	at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
	at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
	at sun.net.www.MeteredStream.read(MeteredStream.java:116)
	at java.io.FilterInputStream.read(FilterInputStream.java:116)
	at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2446)
	at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2441)
        ...
The file is on IIS web server, its a static file, not a server script, web service, or anything special. I usually can download 10-30 mb before this exception occurs. I'm using java 1.6.0_11 on windows xp, anyone have suggestions or experience downloading large files with java?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 9 2010
Added on Mar 12 2010
3 comments
322 views