在IIS的情况下检查从远程文件的标题中的最后修改

时间:2011-10-09 09:00:36

标签: php http-headers last-modified

为什么IIS不返回文件的上次修改时间日期?

Array (
    [headers] => Array (
        [Date] => Sun, 09 Oct 2011 08:57:43 GMT
        [Server] => Microsoft-IIS/6.0
        [X-Powered-By] => ASP.NET
        [X-AspNet-Version] => 2.0.50727
        [Location] => /home.aspx
        [Cache-Control] => private
        [Content-Type] => text/html; charset=iso-8859-1
        [Content-Length] => 129
    )
    [info] => Array (
        [url] => http://www.adleradelboden.ch/webcam/Adler000.JPG
        [content_type] => text/html; charset=iso-8859-1
        [http_code] => 302
        [header_size] => 250
        [request_size] => 220
        [filetime] => -1
        [ssl_verify_result] => 0
        [redirect_count] => 0
        [total_time] => 0.077872
        [namelookup_time] => 0.041748
        [connect_time] => 0.058456
        [pretransfer_time] => 0.058463
        [size_upload] => 0
        [size_download] => 129
        [speed_download] => 1656
        [speed_upload] => 0
        [download_content_length] => 129
        [upload_content_length] => 0
        [starttransfer_time] => 0.077829
        [redirect_time] => 0
        [certinfo] => Array ( )
    )
    [curl_handle] => Resource id #5
)

1 个答案:

答案 0 :(得分:1)

http://www.adleradelboden.ch/webcam/Adler000.JPG的响应标头:

HTTP/1.1 200 OK
Content-Length: 59080
Content-Type: image/jpeg
Last-Modified: Sun, 09 Oct 2011 09:32:42 GMT
Accept-Ranges: bytes
ETag: "d7df1646686cc1:d2487"
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Date: Sun, 09 Oct 2011 09:40:24 GMT

有Last-Modified标头。

您还没有告诉我们您如何获得此信息。但是通过查看您收到的标头,会有Location标头,因此您的请求会被重定向。您应该将curl设置为跟随位置