Using fseek is really slow. This one really better and faster.
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
$size = trim(exec("for %F in (\"" . $file . "\") do @echo %~zF"));
}
elseif ((PHP_OS == 'Linux') || (PHP_OS == 'FreeBSD') || (PHP_OS == 'Unix') || (PHP_OS == 'SunOS')) {
$size = trim(shell_exec("stat -c%s " . escapeshellarg($file)));
} else {
$size = filesize($file);
}