faqts : Computers : Programming : Languages : PHP : Function Libraries : File Handling

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

7 of 9 people (78%) answered Yes
Recently 6 of 8 people (75%) answered Yes

Entry

filesize() function won't work on external files. i did a fopen() on the url but still no luck.

Sep 25th, 2001 14:53
Robert Ames, James Wirth,


It is impossible to know the size of files which are not on the
immediate hard drive of your webserver.  The only way I can think of is
to fread() the information into a string, and count the size of the
string (only useful for very small files) or to create a script on the
remote system (ie: get_file_size.php) which takes a single parameter and
returns the file size in the body of the HTML.

--Robert