0

In our VB6 application, we are using vbmhwb.dll and downloading a file over the web. The files get downloaded properly, but it returns different values of Content-Length. I discovered that the HTTP headers had different Content-Encoding. Below are the HTTP headers for the same file on different PCs. The files were binary identical after download. So when does Content-Encoding get set? Also, how do I get the actual size of the file from the header?

File 1:

HTTP/1.0 200 OK
Date: Fri, 11 Apr 2014 09:19:15 GMT
Server: Application Server
Content-Disposition: attachment; filename=ABC.csi
Content-Type: text/plain
Content-Length: 671
Connection: close

File 2:

HTTP/1.0 200 OK
Date: Fri, 11 Apr 2014 10:28:06 GMT
Server: Application Server
Content-Disposition: attachment; filename=ABC.csi
Content-Type: text/plain
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
Content-Length: 416
Connection: close
Mark Bertenshaw
  • 5,594
  • 2
  • 27
  • 40
IT researcher
  • 3,274
  • 17
  • 79
  • 143
  • 1
    Your http request contains `Content-Encoding: gzip` too, which informs server that your client can understand gzip compressed response. Remove this headers from your request and the web server will always respond with actual `Content-Length`. – wqw Apr 11 '14 at 14:52
  • @wqw I am just using web navigate function. I don't send anything in http header request. – IT researcher Apr 12 '14 at 06:11

0 Answers0