Retrieve time-stamp of HTTP file using WinHttp function

419 Views Asked by At

How to get the time stamp of a file, that can be downloaded from HTTP server, using HTTP protocol? I am particularly interested in WinHttp functions, but any HTTP reference will do.

There is a time-stamp field in response-header, but that refers the time when the HTTP server responded, and not the file-time of the file.

1

There are 1 best solutions below

0
On BEST ANSWER

To retrieve the creation/modified date-time of a file received over HTTP, there exists a field Last-Modified within the HTTP response header.

As the documentation says:

The Last-Modified entity-header field indicates the date and time at which the origin server believes the variant was last modified [...] The exact meaning of this header field depends on the implementation of the origin server and the nature of the original resource. For files, it may be just the file system last-modified time

WinHttp function to retrieve the header info is WinHttpQueryHeaders.