Search results for 'PHP COM-extensions'. 1 post(s) found.
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:
<?
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");
?>Another posts included in "PHP"
| How to convert W3C Date Time Format ? (0) | 2008/02/28 |
| How to put timeout when opening URL by fopen ? (0) | 2008/03/31 |
| How to limit by Timeout when opening URL ? (0) | 2008/04/14 |
| ISO 8601 format time format string conversion (0) | 2008/02/13 |
| How to download a file from a certain URL to server ? (0) | 2008/01/21 |
| How to extract file name from given URL ? (0) | 2008/01/21 |
| File downloading via HTTP (0) | 2008/01/21 |
| How to block a connection from the certain site ? (0) | 2008/01/14 |

Prev

Rss Feed