Re: reading filesize on remote server
| From: | Torsten Roehr | Date: | Thu, 05 Aug 2004 13:08:11 +0000 |
| Subject: | Re: reading filesize on remote server | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-192851@lists.php.net to get a copy of this message | ||
"Tobias grønlund" <tobias@edev.dk> wrote in message
news:20040805121527.40159.qmail@pb1.pair.com...
> Im having a problem reading filesizes on a remote server, hven only
> having the domainname, and not the exact filename.
> (i want to use it to read the filesize and thereby the downloadtime of
> the html-file, and it all schould happen automaticly when someone writes
> the domainname at my webpage) )
>
> i've tried this:
>
> $filename = 'http://www.example.com';
> $fp = fopen($filename, "r");
> $size = filesize($filename);
> echo $size;
> fclose($fp);
>
> but it only returns this error:
>
> Warning: filesize(): Stat failed for http://www.example.com
> (errno=2 -
> No such file or directory)
>
> WHAT AM I DOING WRONG???
>
> Tobias, Denmark
Hi,
take a look at the user comments on:
http://de3.php.net/function.filesize
Regards, Torsten Roehr