# Misbehaving proxy : differentiating jpegs

**URL:** <https://forum.kirupa.com/t/misbehaving-proxy-differentiating-jpegs/226642>\
**Category:** Uncategorized\
**Created:** [May 22, 2007, 8:46pm UTC](https://forum.kirupa.com/t/misbehaving-proxy-differentiating-jpegs/226642 "2007-05-22T20:46:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jazgold](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@jazgold](https://forum.kirupa.com/u/jazgold)\
**Post date:** [May 22, 2007, 8:46pm UTC](https://forum.kirupa.com/t/misbehaving-proxy-differentiating-jpegs/226642/1 "2007-05-22T20:46:22Z")

</div>

so i need to run my external resources through a very simple proxy shown below:

```php
<?php
$url = $_GET['rsrc'];
header( "content-type:image/jpeg" );
echo readfile($url);
?>

```

it works for many jpegs.

for example here it is pulling something i grabbed off a google image serarch:  
[![](http://www.themagicmarble.com/v2/localProxyTest.php?rsrc=http://www.drtoy.com/images/books/smart_play_cover_actual_size.jpg) ](http://www.themagicmarble.com/v2/localProxyTest.php?rsrc=http://www.drtoy.com/images/books/smart_play_cover_actual_size.jpg)

but for some reason, it doesn’t work for some jpegs. here’s another one i grabbed from google:  
[![](http://www.themagicmarble.com/v2/localProxyTest.php?rsrc=http://www.telegraph.co.uk/arts/graphics/2007/05/18/bfdecino400.jpg) ](http://www.themagicmarble.com/v2/localProxyTest.php?rsrc=http://www.telegraph.co.uk/arts/graphics/2007/05/18/bfdecino400.jpg)

it’s not even recognizing the second as an image as an image…

are there different headers for different types of jpegs? do i need to differentiate?

[[EDIT]] with the image that does not load, firefox simply spits back the url i entered, but in IE, there’s an error message:

> \<br /\>  
> \<b\>Warning\</b\>: readfile([http://www.telegraph.co.uk/arts/graphics/2007/05/18/bfdecino400.jpg):](http://www.telegraph.co.uk/arts/graphics/2007/05/18/bfdecino400.jpg%29:) failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in \<b\>/home/0/c/9/8143/8143/public\_html/v2/localProxyTest.php\</b\> on line \<b\>12\</b\>\<br /\>  
> is it possible that the specific server that houses the image denies the “readfile()” command from external domains? hmmmmmm…

anyone know about this domain?
