If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Look at the the methods for the URLConnection class. One of those gets the content length for you.

I saw the documentation and i know you are talking about
getContentLength(). The thing is that it returns an int. What if it is a huge zip file, would not a long be better. Another thing is the length format that it returns was not specified(ie. whether its in bytes, kilobytes or megabytes)
that's why i am confused.

bytes.
Have you tried to download a HUGH file with a browser? What does it do?
I'm on a slow connection, bigger than 50M takes hours and hours!
I really doubt that any file you want to download can be over a billion bytes!
Do you know how large a number can be held in an int?
If so, there is something wrong with your design.