[PHP] fpassthru (was: fgets)

2001-08-30 Thread Joseph Bannon

What exactly does fpassthru do? Does it download it to my server and then
shoot it to the browser??

Joseph













-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] fpassthru (was: fgets)

2001-08-30 Thread Christopher William Wesley

On Thu, 30 Aug 2001, Joseph Bannon wrote:

 What exactly does fpassthru do? Does it download it to my server and then
 shoot it to the browser??

(http://php.net/fpassthru)

For the file pointer on which it operates, it reads the file pointer until
EOF and sends the data to STDOUT.  It is very much like the 'cat' command
in Unix.  The file pointer can be to a local or remote file opened with
fopen(), or a remote data source opened with fsockopen().

And as always, there's a gem in the docs ... readfile() does the
same thing as fpassthru() but doesn't need a file pointer.  It just needs
a path to a file, so you can eliminate the fopen().

~Chris   /\
 \ / Pine Ribbon Campaign
Microsoft Security Specialist X  Against Outlook
The moron in Oxymoron.   / \ http://www.thebackrow.net


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] fpassthru (was: fgets)

2001-08-30 Thread Joseph Bannon

The thing I want to avoid is using my server's bandwidth. Each member gets a
profile and can have a photo referenced from their homepage. I use to allow
people to upload photos, but I'm getting close to using my 60GB bandwith
limit. The people that have photos on geocities couldn't reference a photo
because their servers don't allow remote hosts displaying pictures off their
site. Using 'fpassthru' fixed that. However, my next question is if the
'fpassthru' brings the information to my server and then shoots it to the
visitor's browser. I know I'm not saving their photos to my server, I just
want to make sure I'm not killing my alotted bandwith. Does 'fpassthru' do
this? If so, is there another solution?

Thanks for helping me with this.

Joseph




-Original Message-

On Thu, 30 Aug 2001, Joseph Bannon wrote:

 What exactly does fpassthru do? Does it download it to my server and then
 shoot it to the browser??

(http://php.net/fpassthru)

For the file pointer on which it operates, it reads the file pointer until
EOF and sends the data to STDOUT.  It is very much like the 'cat' command
in Unix.  The file pointer can be to a local or remote file opened with
fopen(), or a remote data source opened with fsockopen().

And as always, there's a gem in the docs ... readfile() does the
same thing as fpassthru() but doesn't need a file pointer.  It just needs
a path to a file, so you can eliminate the fopen().













-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] fpassthru (was: fgets)

2001-08-30 Thread Christopher William Wesley

On Thu, 30 Aug 2001, Joseph Bannon wrote:

 The thing I want to avoid is using my server's bandwidth. Each member gets a
 profile and can have a photo referenced from their homepage. I use to allow
 people to upload photos, but I'm getting close to using my 60GB bandwith
 limit. The people that have photos on geocities couldn't reference a photo
 because their servers don't allow remote hosts displaying pictures off their
 site. Using 'fpassthru' fixed that. However, my next question is if the
 'fpassthru' brings the information to my server and then shoots it to the
 visitor's browser. I know I'm not saving their photos to my server, I just
 want to make sure I'm not killing my alotted bandwith. Does 'fpassthru' do
 this? If so, is there another solution?

If the image you're sending to the browser comes from a remote host,
unfortunately, yes, that image data does get transferred to your server,
and then gets transferred again to the users' browsers.  Since PHP is a
server-side solution, there isn't a way to skip out on the data transfer
to your server and use PHP to send the image.  The image data has to come
from your server when using PHP.  You may have to get creative with HTML,
DHTML, etc. to work around displaying the remote images from your site.

~Chris   /\
 \ / Pine Ribbon Campaign
Microsoft Security Specialist X  Against Outlook
The moron in Oxymoron.   / \ http://www.thebackrow.net


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] fpassthru (was: fgets)

2001-08-30 Thread Joseph Bannon

Dang it! -lol Any ideas how to get around my problem?

J


















-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] fpassthru (was: fgets)

2001-08-30 Thread Joseph Bannon

What if I pass something in the header? Will that work?

Joseph

-Original Message-
From: Christopher William Wesley [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 30, 2001 1:05 PM
To: PHP (E-mail)
Subject: RE: [PHP] fpassthru (was: fgets)


On Thu, 30 Aug 2001, Joseph Bannon wrote:

 The thing I want to avoid is using my server's bandwidth. Each member gets
a
 profile and can have a photo referenced from their homepage. I use to
allow
 people to upload photos, but I'm getting close to using my 60GB bandwith
 limit. The people that have photos on geocities couldn't reference a photo
 because their servers don't allow remote hosts displaying pictures off
their
 site. Using 'fpassthru' fixed that. However, my next question is if the
 'fpassthru' brings the information to my server and then shoots it to the
 visitor's browser. I know I'm not saving their photos to my server, I just
 want to make sure I'm not killing my alotted bandwith. Does 'fpassthru' do
 this? If so, is there another solution?

If the image you're sending to the browser comes from a remote host,
unfortunately, yes, that image data does get transferred to your server,
and then gets transferred again to the users' browsers.  Since PHP is a
server-side solution, there isn't a way to skip out on the data transfer
to your server and use PHP to send the image.  The image data has to come
from your server when using PHP.  You may have to get creative with HTML,
DHTML, etc. to work around displaying the remote images from your site.














-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]