'File Size'에 해당되는 글 1건
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 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");
?>

Prev

Rss Feed