You are here: Re: filesize() not reading http pages « All PHP « IT news, forums, messages
Re: filesize() not reading http pages

Posted by Kim Andrι Akerψ on 02/01/07 15:52

Eric Layman wrote:

> Hi,
>
> According to the PHP documentation:
>
> it stated that as of php5, filesize supports the reading of remote
> html files:
>
> http://php.net/manual/en/function.filesize.php
>
> But I have tried the following:
> echo filesize("http://www.yahoo.com/");
>
> It returned me this error:
>
> Warning: filesize() [function.filesize]: stat failed for..blah blah
>
> Anyone have this same problem?
>
> Yes. Im using PHP5

It also says in the manual (you have to read it carefully):

> As of PHP 5.0.0 this function can also be used with *some* URL
> wrappers. Refer to Appendix M for a listing of which wrappers support
> stat() family of functionality.

To summarize, these wrappers support the use of stat():

Filesystem Yes
Socket No
HTTP and HTTPS No
FTP and FTPS Partial [1]
PHP input/output streams php://memory and php://temp only
Compression Streams No [2]
Data (RFC 2397) No
Secure Shell 2 ssh2.ftp only
Audio Streams No
Process Interaction Streams No
http://www.php.net/manual/en/wrappers.php

[1] As of PHP 5.0.0: filesize(), filetype(), file_exists(), is_file(),
and is_dir() elements only. As of PHP 5.1.0: filemtime().
[2] Use the normal file:// wrapper to stat compressed files.

--
Kim AndrΓ© AkerΓΈ
- kimandre@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация