Re: Re: fopen, fread
| From: | Simon Roberts | Date: | Sat, 22 Sep 2001 13:11:27 +0000 |
| Subject: | Re: Re: fopen, fread | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-68321@lists.php.net to get a copy of this message | ||
Check the value of filesize($fileName). It's probably not working - either
because PHP doesn't support it with URLs (likely) or that it's can't get the
length from the webserver (less likely).
PS: don't cross-post this sort of message to php-dev. That's for people
developing PHP, not developing *in* PHP.
----- Original Message -----
From: "CC Zona" <cczona@nospam.invalid>
To: <php-general@lists.php.net>; <php-dev@lists.php.net>
Sent: Saturday, September 22, 2001 4:32 PM
Subject: [PHP-DEV] Re: fopen, fread
> In article <20010921174303.5627.qmail@pb1.pair.com>,
> dries@plessers.com (Dries Plessers) wrote:
>
> > Can anybody tell me what is wrong. $file contains nothing ?????
>
> > $fileName="http://www.proxis.com";
> > $fp=fopen($fileName, "r");
> > $file=fread($fp, filesize($fileName));
> > fclose($fp);
> > print("$file");
>
> Not a good idea to just assume that every fopen will be successful (and
> therefore go ahead with the read) or that every fread will be successful
> (and therefore go ahead with the print). Throw some error checking in
> there, and PHP will likely tell you where the code is failing and why.
>
> --
> CC
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>