Short answer: use the HTTP HEAD command available in the TIdHttp Indy Delphi component.
More details:
The HTTP protocol defines the HEAD method.
9.4 HEAD
The HEAD method is identical to the GET method except that the server SHOULD NOT return the message body in the response. the meta information contained in the HTTP headers in response to the HEAD request MUST be identical to the information sent in response to the GET request. This method can be used to obtain meta-information about an object implied by a request without transmitting the essential body itself. This method is often used to test hypertext links for validity, accessibility, and recent modification.
The response to the HEAD request MAY be cache in the sense that the information contained in the response MAY be used to update a previously cached object from this resource. If the new field values ββindicate that the cached object is different from the current one (as indicated by a change in Content-Length, Content-MD5, ETag, or Last-Modified), then the cache MUST treat the cache entry as obsolete.
HEAD requests a response identical to the one corresponding to the GET request, but without the response body, receiving full response headers, without all the content.
The resulting HTTP response headers are documented in the Wikipedia HTTP header list. http://en.wikipedia.org/wiki/List_of_HTTP_headers
The HTTP headers form the core of the HTTP request, and are very important in the HTTP response. They determine the various characteristics of the data that is requested or the data that has been provided. The headers are separated from the request or the response body is an empty string. HTTP headers can be almost arbitrary strings, but only a few are commonly understood.
One of the headers that is always present for a valid content retrieval URL is the Content-Length header.
14.13 Content-Length
The Content-Length entity-header field indicates the size of the entity-body, in decimal OCTET, sent to the recipient, or, in the case of the HEAD method, the size of the entity body that would be sent if the request was GET.
Content-Length = "Content-Length" ":" 1*DIGIT
An example is
Content-Length: 3495
Applications SHOULD use this field to indicate the length of the body-message transmission, unless prohibited by the rules in section 4.4.
Any content length greater than or equal to zero is a valid value. Section 4.4 describes how to determine the message body length if no Content-Length is specified.
Please note that the value of this field is significantly different from the corresponding definition in MIME, where this is an optional field used within the "Message / external-body" content type. In HTTP, it MUST be sent whenever the length of the message can be determined before transmission, unless prohibited by the rules in section 4.4.
From Delphi, drop the TIdHttp component into your form. And paste the following code into one of your delphi event handling methods.
var url: string;