Consequently, the fopen() call doesn't return the proper resource.
How do I get to this file?
Thanks,
--Josh
----------------------------------------------
Code:
$body = fopen("http://slate.msn.com/apps/myslate/action/save.aspx?ids=toc",
"r");
foreach ( $http_response_header as $response) {
echo "$response<br>\n";
}
if (!$fp) {
die("error: the file didn't open");
} else {
die("success!");
}
Returns:
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Wed, 28 Jan 2004 00:41:01 GMT
P3P:CP="BUS CUR CONo FIN IVDo ONL OUR PHY SAMo TELo"
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Content-Disposition: attachment; filename=Slate 1-27-04.htm
Cache-Control: private
Content-Type: text/x-anything; charset=utf-8
Content-Length: 852060
error: the file didn't open
> I'm writing a web scraper, and the file I'm downloading returns the
> following header: Content-Disposition: attachment; filename=Slate
> 1-27-04.htm
>
> Consequently, the fopen() call doesn't return the proper resource.
>
> How do I get to this file?
>
> Thanks,
> --Josh
>
> ----------------------------------------------
> Code:
>
> $body =
> fopen("http://slate.msn.com/apps/myslate/action/save.aspx?ids=toc",
> "r");
>
> foreach ( $http_response_header as $response) {
> echo "$response<br>\n";
> }
>
> if (!$fp) {
> die("error: the file didn't open");
> } else {
> die("success!");
> }
>
but above you use $body? shouldn't you check $body instead of $fp?
chris