FileSize -1

sampoo

Active member
Joined
Jun 12, 2004
Messages
25
Location
Belgium
Programming Experience
3-5
Hi , i use this code to retrieve the size of a file on the web...

VB.NET:
  			Dim URLReq As Net.HttpWebRequest
  			Dim URLRes As Net.HttpWebResponse 
  
  Dim FileSize as Long
  
  			URLReq = Net.WebRequest.Create(sURL)
  			URLRes = URLReq.GetResponse
  
  			FileSize = URLRes.ContentLength

For one URL it gives the correct filesize, but for another file it gives FileSize=-1 :s

What could be the reason?


Thanks
 
Top Bottom