I have a piece of code that is designed to retrieve any url and tear it out of the internet. While this works fine, until someone gave him this URL:
http://www.aspensurgical.com/static/images/aspen_hill-rom_logo.png
If I hit it from my browser, it shows that everything is fine. But when I try to curl it down, I get:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /static/images/aspen_hill-rom_logo.png
on this server.</p>
<hr>
<address> Server at www.aspensurgical.com Port 80</address>
</body></html>
The CURL code I use:
$ch = curl_init(str_replace(' ', '%20', $url));
$fh = fopen($local_file, "w");
curl_setopt($ch, CURLOPT_FILE, $fh);
curl_exec($ch);
curl_close($ch);
Is their server somehow realizing that I am not a normal browser and loading me?
source
share