'File Size'에 해당되는 글 1건

  1. 2008/02/24 Get the actual filesize for a size above 2GB in Windows
2008/02/24 15:46

Get the actual filesize for a size above 2GB in Windows

If you want to get the actualfilesize for a size above 2GB in Windows, you can use theCOM-extensions in PHP.

An example is as follows:
<?
function KF
ileSize($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");
?>
Trackback 0 Comment 0