ID: 39475 User updated by: j dot finlay at optusnet dot com dot au -Summary: HTTP/FTP and filesize() Reported By: j dot finlay at optusnet dot com dot au Status: Open Bug Type: Documentation problem Operating System: Linux PHP Version: Irrelevant New Comment:
Changed summary from "HTTP/FTP and filesize()" to just "FTP and filesize()". Previous Comments: ------------------------------------------------------------------------ [2006-11-12 06:49:19] j dot finlay at optusnet dot com dot au Description: ------------ According to the documentation, filesize() supports wrappers that also support stat(). This seems to be false with both PHP 5.1.6, and 5.2.1-dev. Unfortunately this function does not work as expected with FTP URLs. See the reproducable code for an example. However, the manual states that "As of PHP 5.0.0 this function can also be used with some URL wrappers. Refer to Appendix M, List of Supported Protocols/Wrappers for a listing of which wrappers support stat() family of functionality." >From the manual, in regards to "Appendix M, List of Supported Protocols/Wrappers" in the "FTP and FTPS" section: "Supports stat() No As of PHP 5.0.0: filesize(), filetype(), file_exists(), is_file(), and is_dir() elements only. As of PHP 5.1.0: filemtime()." Reproduce code: --------------- <?php print filesize("http://au2.php.net/distributions/php-5.2.0.tar.bz2")."\n"; ?> Expected result: ---------------- 6789838 Actual result: -------------- Warning: filesize(): stat failed for http://au2.php.net/distributions/php-5.2.0.tar.bz2 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39475&edit=1