By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,722 Members | 1,174 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,722 IT Pros & Developers. It's quick & easy.

filesize

P: n/a
Hi all,

I'd like to evaluate dynamicaly the size of a dynamic file.
I use the filesize() function...

this is my code :
$my_size =
filesize(http://localhost/the_file_from_which...t_the_size.php) ;

=> I always get 0 !
Do you have any solution ?

thanks in advance,

--
john
Jul 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hello,

On 10/02/2004 03:29 PM, John wrote:
I'd like to evaluate dynamicaly the size of a dynamic file.
I use the filesize() function...

this is my code :
$my_size =
filesize(http://localhost/the_file_from_which...t_the_size.php) ;

=> I always get 0 !
Do you have any solution ?


if the page is generated dynamically, the only solution is to retrieve
it and count the number of bytes in it.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #2

P: n/a
iuz
John wrote:
Hi all,

I'd like to evaluate dynamicaly the size of a dynamic file.
I use the filesize() function...

this is my code :
$my_size =
filesize(http://localhost/the_file_from_which...t_the_size.php)
; [..] --
john


you forget the '"' and you must declarate the file name in the following
form.. try this..
(if the script is in the same directory of the file you want to examine)
$my_size = filesize("./the_file_from_which_i_want_to_get_the_size.php");

--
www.iuz-lab.info
Jul 17 '05 #3

P: n/a
John <jo**@nospam.org> wrote:
Hi all,

I'd like to evaluate dynamicaly the size of a dynamic file.
I use the filesize() function...

this is my code :
$my_size =
filesize(http://localhost/the_file_from_which...t_the_size.php) ;

=> I always get 0 !
Do you have any solution ?

thanks in advance,


<http://php.net/filesize> clearly states:
| *Tip:* As of PHP 5.0.0 this function can also be used with /some/ URL
| wrappers. Refer to _Appendix L_ for a listing of which wrappers support
| *_stat()_* family of functionality.

Now Appendix L on HTTP(S) <http://php.net/wrappers.http>:
| Attribute Supported
| Restricted by allow_url_fopen. Yes
| Allows Reading Yes
| Allows Writing No
| Allows Appending No
| Allows Simultaneous Reading and Writing N/A
| Supports stat() No <-- LOOK HERE!
| Supports unlink() No
| Supports rename() No
| Supports mkdir() No
| Supports rmdir() No

A simple RTFM gives the answer... nice, huh?
--
Simon Stienen <http://dangerouscat.net> <http://slashlife.de>
»What you do in this world is a matter of no consequence,
The question is, what can you make people believe that you have done.«
-- Sherlock Holmes in "A Study in Scarlet" by Sir Arthur Conan Doyle
Jul 17 '05 #4

P: n/a
> <http://php.net/filesize> clearly states:
| *Tip:* As of PHP 5.0.0 this function can also be used with /some/ URL
| wrappers. Refer to _Appendix L_ for a listing of which wrappers support
| *_stat()_* family of functionality.

Now Appendix L on HTTP(S) <http://php.net/wrappers.http>:
| Attribute Supported
| Restricted by allow_url_fopen. Yes
| Allows Reading Yes
| Allows Writing No
| Allows Appending No
| Allows Simultaneous Reading and Writing N/A
| Supports stat() No <-- LOOK HERE!
| Supports unlink() No
| Supports rename() No
| Supports mkdir() No
| Supports rmdir() No

A simple RTFM gives the answer... nice, huh?


I already RTFM... but my Php version is 4.3.8 :-/
anyway, thx for you help.

--
john
Jul 17 '05 #5

P: n/a
>
you forget the '"' and you must declarate the file name in the following
form.. try this..
(if the script is in the same directory of the file you want to examine)
$my_size = filesize("./the_file_from_which_i_want_to_get_the_size.php");

--
www.iuz-lab.info


The trouble is that the Php file read locally is 3 kb as it is some 8 to 10
kb when interpreted...

--
john
Jul 17 '05 #6

P: n/a
John <jo**@nospam.org> wrote:
<http://php.net/filesize> clearly states:
| *Tip:* As of PHP 5.0.0 this function can also be used with /some/ URL
| wrappers. Refer to _Appendix L_ for a listing of which wrappers support
| *_stat()_* family of functionality.

Now Appendix L on HTTP(S) <http://php.net/wrappers.http>:
| Attribute Supported
| Restricted by allow_url_fopen. Yes
| Allows Reading Yes
| Allows Writing No
| Allows Appending No
| Allows Simultaneous Reading and Writing N/A
| Supports stat() No <-- LOOK HERE!
| Supports unlink() No
| Supports rename() No
| Supports mkdir() No
| Supports rmdir() No

A simple RTFM gives the answer... nice, huh?


I already RTFM... but my Php version is 4.3.8 :-/
anyway, thx for you help.


Then the first part on its own suffices as your way to enlightment...
--
Simon Stienen <http://dangerouscat.net> <http://slashlife.de>
»What you do in this world is a matter of no consequence,
The question is, what can you make people believe that you have done.«
-- Sherlock Holmes in "A Study in Scarlet" by Sir Arthur Conan Doyle
Jul 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.