Title: Find size of a file or image in PHP Post by: Hellraiser on August 29, 2007, 10:32:24 AM Find size of a file or image in PHP
You can find the filesize using an inbuild PHP function filesize(). And display the filesize in human readable format use again PHP function number_format Example Assume that all the files are stored in a folder called download Code: $my_file=download/abc.doc; abc.doc is the filename but where did we get it? answer from the database. How? like this-> Assume the database has already been connected. Now open the table retrieve the file name. Assume again a table called file exists with what ever fields. Code: $res=mysql_query("select * from file"); |