Archived Forum Post

Index of archived forum posts


Chilkat HTTP Object (Activex) not get correct file size..

Nov 11 '13 at 10:45


i am facing a problem..

i need to get file size by using chilkat HTTP object. but it returns false value ..

this is an example url:

Internet download manager shows file size is 6.27MB..

but chilkat HTTP object return 176/174 bytes (sometimes 174 and sometimes 176) bytes only :(


P.S i use following code to get file size:

any help would be highly appreciated :)

thanks in advance..

best regards


so, no helps?



I just tried it and I am getting the correct file size. This code:

Sub TestHttp()
  Dim lo_Http As ChilkatHttp
  Dim lo_HttpResp As ChilkatHttpResponse

  Set lo_Http = New ChilkatHttp
  lo_Http.UnlockComponent "UnlockCode"

  Set lo_HttpResp = lo_Http.GetHead("")
  Debug.Print "File size in bytes: " & Format$(lo_HttpResp.GetHeaderField("Content-Length"), "#,##0")
End Sub

Produces the following result for me:

File size in bytes: 6,560,454


Hi mAlam,

There are 2 important things that have not been answered:

  1. Are you using ChilkatHTTP 9.4.1? If not you should update and try your code again, the problem may have already been fixed.
  2. Can you post the results of the Header property of the ChilkatHTTPResponse object immediately after your call the GetHead method of the ChilatHTTP object?