khurram4m
khurram4m

Reputation: 35

Error downloading Image files using PHP

I have written a PHP script to download image files it works as desired but it is not downloading files from certain hosts eventhough there doesn't seems to be any hotlinking restriction

take an example fo this image

http://new.picsbees.com/upload/big/2014/07/18/53c98c72cce24.jpg

if I paste it in browser it works but when I down load it using PHP then the downloaded file has following data into it

<iframe src="http://202.125.134.154/webadmin/deny/?dpid=1&dpruleid=78&cat=23&ttl=-200&groupname=default&policyname=default&username=-&userip=39.142.127.202&connectionip=127.0.0.1&nsphostname=KHI275-NSP-08&protocol=policyprocessor&dplanguage=-&url=http%3a%2f%2fnew%2epicsbees%2ecom%2fupload%2fbig%2f2014%2f07%2f18%2f53c98c73413d8%2ejpg" width="100%" height="100%" frameborder=0></iframe>

And these are the core statments I'm using to download images

$local_image_file = fopen($filename, 'w');
chmod(filename,0755);
fwrite($local_image_file, $image_to_fetch);
fclose($local_image_file);

Please help me understand what is the issue

Upvotes: 0

Views: 522

Answers (1)

David Jacquel
David Jacquel

Reputation: 52829

You're in Pakistan. So it's pure censorship. The server hosting your application, or your service provider is filtering what you're allowed to see.

enter image description here

Upvotes: 1

Related Questions