note 73262 added to function.filesize

From: Date: Thu, 15 Feb 2007 02:46:38 +0000
Subject: note 73262 added to function.filesize
Groups: php.notes 
Request: Send a blank email to php-notes+get-123398@lists.php.net to get a copy of this message
WARNING: You don't want to use h4x0r_elite solution for getting a filesize. his solution actualy loads the ENTIRE file into memory and checks howmany bytes have been loaded. so imagine you have have a file of lets say 400Megabytes. by doing a 'file_get_contents' your script wil be comsuming 400Megabytes of memory. it will also transfer the entire file and your lucky if you get stopped by the memory limit in php. depending on the kind of remote file there are better methods such as a HTTP HEAD request wich will return just only the HTTP Headers. use the 'Lenght' header for your filesize. also most ftp server do support ftp_size functions and the filesize is also listed in the ftp_rawlist function. ---- Server IP: 194.109.193.76 Probable Submitter: 82.75.121.187 ---- Manual Page -- http://www.php.net/manual/en/function.filesize.php Edit -- https://master.php.net/note/edit/73262 Del: integrated -- https://master.php.net/note/delete/73262/integrated Del: useless -- https://master.php.net/note/delete/73262/useless Del: bad code -- https://master.php.net/note/delete/73262/bad+code Del: spam -- https://master.php.net/note/delete/73262/spam Del: non-english -- https://master.php.net/note/delete/73262/non-english Del: in docs -- https://master.php.net/note/delete/73262/in+docs Del: other reasons-- https://master.php.net/note/delete/73262 Reject -- https://master.php.net/note/reject/73262 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#123398) next »