cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: How can I get Directory listing with HTTP

From: Jochen Roderburg <Roderburg_at_uni-koeln.de>
Date: Tue, 18 May 2010 10:40:58 +0200

Zitat von Avinash <pavinash_at_gmail.com>:

> Basically my requirement is to get the metadata of file pointed by HTTP URL
> and not the actual file.
>
> e.g if my URL is
> http://172.20.241.206/HTTP_Share/performance_data/mixed/pdf/6.pdf
>
> Then I do not want to download the file 6.pdf, but the metadata of 6.pdf
> like its size, access time, modification time etc.
>
> Is there any way to get all this meta-information without actually
> downloading it ?
>

Aaaah, that's now something "completely different" and can be made
with HTTP, namely with a so-called HEAD Request. ;-)
Size and modification time of a file are mostly part of the HEAD resposne.

With curl: curl --head URL
With wget: wget --server-response --spider URL

Regards,
J.Roderburg

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-05-18