readfile() on external images effect on bandwidth?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cdunn
Forum Newbie
Posts: 2
Joined: Sat Sep 16, 2006 2:18 am

readfile() on external images effect on bandwidth?

Post by cdunn »

Hello everyone!

If I am reading jpegs off an external site (like flickr), will something like the following actually use my bandwidth for loading the image?...I guess the better way to say it is, does the image actually go through my server if I do this?

<?
$path = $_GET['image'];
header("Content-type: image/jpg");
@readfile($path);
?>

Cheers!
Cary
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

cdunn wrote:If I am reading jpegs off an external site (like flickr), will something like the following actually use my bandwidth for loading the image?
does it use the provider's internet capacity ? Yes it does.
cdunn
Forum Newbie
Posts: 2
Joined: Sat Sep 16, 2006 2:18 am

Post by cdunn »

thanks for the reply!

by internet providers capacity, you do mean my webhost correct?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Yo. They have to pay for incoming/outgoing traffic, too. And therefore they probably will take incoming traffic (such as reading the image data from another external host) into account. If you want to be sure ask your webhoster.
Post Reply