How can u get the Length of a file u are going to download?
HI,
I have another question, is it possible that u can get the length of a file which u are just going to download?
I have the following code example:
url =new URL(dlfrom);<br>
f=new File(url.toURI());<br>
System.out.println(f.length)();<br>
unfortunatly it keeps throwing an exception, please help.
[427 byte] By [
betlora] at [2007-10-2 20:29:09]

> RTFM
>
> http://java.sun.com/j2se/1.5.0/docs/api/java/net/URLCo
> nnection.html#getContentLength()
I tried to apply your sollution, but it is allways returning -1, so what should I do now, is there any possebility still to get the length of the object, because i thought of doing something similar as a tool to download stuff