note 104101 added to function.filesize
| From: | swimmingatgmxdotde at osu1 dot php dot net | Date: | Mon, 23 May 2011 07:53:12 +0000 |
| Subject: | note 104101 added to function.filesize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-179948@lists.php.net to get a copy of this message | ||
I found the following to be a nice solution (if you are running Windows) for the >4GB problem.
Using the Windows internal Scripting.FileSystemObject you can get the file size using the following
code:
<?php
$filesystem = new COM('Scripting.FileSystemObject');
$file = $filesystem->GetFile($filename);
$size = $file->Size();
?>
The file size will be returned as integer for small files, automatically changing to float for
bigger ones. The COM class is part of the PHP core.
----
Server IP: 212.124.37.9
Probable Submitter: 129.247.247.240
----
Manual Page -- http://www.php.net/manual/en/function.filesize.php
Edit -- https://master.php.net/note/edit/104101
Del: integrated -- https://master.php.net/note/delete/104101/integrated
Del: useless -- https://master.php.net/note/delete/104101/useless
Del: bad code -- https://master.php.net/note/delete/104101/bad+code
Del: spam -- https://master.php.net/note/delete/104101/spam
Del: non-english -- https://master.php.net/note/delete/104101/non-english
Del: in docs -- https://master.php.net/note/delete/104101/in+docs
Del: other reasons-- https://master.php.net/note/delete/104101
Reject -- https://master.php.net/note/reject/104101
Search -- https://master.php.net/manage/user-notes.php