Results 1 to 8 of 8
Threaded View
-
11th Dec 2010, 04:47 PM #2It begins...
This is the function I use to return the filesize of a remote image.
PHP Code:function ffilesize($file){
$ch = curl_init($file);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
$data = curl_exec($ch);
curl_close($ch);
if ($data === false)
return false;
if (preg_match('/Content-Length: (\d+)/', $data, $matches)) {
return (float)$matches[1];
}
elseif (preg_match('/content-length: (\d+)/', $data, $matches)) {
return (float)$matches[1];
}
}
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Faster TV releases?
By EL-Warez in forum Webmaster ResourcesReplies: 24Last Post: 14th May 2012, 12:36 AM -
Make Photosoph Faster
By Faizann20 in forum Graphics AreaReplies: 7Last Post: 8th Nov 2011, 11:10 PM -
Make your Firefox to run faster
By aman8819 in forum Tutorials and GuidesReplies: 10Last Post: 14th Apr 2011, 01:40 AM -
Which CPU is faster?
By mahjong in forum Technical Help Desk SupportReplies: 4Last Post: 10th Mar 2011, 09:07 PM -
How to make my site faster?
By WaReZ in forum Technical Help Desk SupportReplies: 11Last Post: 8th Mar 2011, 06:10 PM
themaCreator - create posts from...
Version 3.55 released. Open older version (or...