M
Marcelo
Dear Programmers,
I have a terrible headache because of this part of my code.
I don't have a clue how to disconnect from a given URL. I would like to
make a download of some images, but the problem is that the connection
may be lost or hanged up.
The url is correct, but the server seems to be down or something like
that for some urls (because it waits for ever...), however, my code get
stuck here:
urlObject = new URL(url);
URLConnection con = urlObject.openConnection();
con.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible;MSIE
5.5; Windows NT 5.0;H010818)" );
int length = con.getContentLength();
<PROBLEM HERE !!!! >
int MAX_IMAGE_SIZE = length;
.....
Some urls that gives me this problem are:
http://www.alientech.to/pic/exelixis03/Auto-Exelixis_045.JPG
http://www.auto-sfondi-desktop.com/...I/Lotus-Elise-II-02/Lotus-Elise-II-02_640.jpg
Do you have any ideas?
thanks a lot,
Marcelo
I have a terrible headache because of this part of my code.
I don't have a clue how to disconnect from a given URL. I would like to
make a download of some images, but the problem is that the connection
may be lost or hanged up.
The url is correct, but the server seems to be down or something like
that for some urls (because it waits for ever...), however, my code get
stuck here:
urlObject = new URL(url);
URLConnection con = urlObject.openConnection();
con.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible;MSIE
5.5; Windows NT 5.0;H010818)" );
int length = con.getContentLength();
<PROBLEM HERE !!!! >
int MAX_IMAGE_SIZE = length;
.....
Some urls that gives me this problem are:
http://www.alientech.to/pic/exelixis03/Auto-Exelixis_045.JPG
http://www.auto-sfondi-desktop.com/...I/Lotus-Elise-II-02/Lotus-Elise-II-02_640.jpg
Do you have any ideas?
thanks a lot,
Marcelo