| If you want to get the actual filesize for a size above 2GB in Windows, you can use the COM-extensions in PHP. An example is as follows: <?php
function KFileSize($file)
{
if (file_exists($file))
{
$fsobj = new COM("Scripting.FileSystemObject");
$file = $fsobj->GetFile($file);
$var = ($file->Size) + 1 - 1;
return $var;
}
else
{
// File does not exist
return 0;
}
}
?>
This will return the corrent filesize. And it is very useful with PHP-GTK applications, where you want to use the filesize for larger files.
This example also works for files over a Windows-network. Try this example with the function: echo KFileSize("c:/tmp/foo.mp3"); |