I wonder if we are able to get the file size of an excel created from phpspreadsheet
. If it's possible, how can I do that? Thanks for the help.
Asked
Active
Viewed 492 times
0

rhog23
- 311
- 2
- 16
-
2does not mater how the file was created: https://secure.php.net/manual/en/function.filesize.php – Apr 24 '18 at 04:55
-
2have you tried `filesize()` ? I know right what an obscure name for getting the size of a file. Who would guess they would use that. As a note excel has a habit of locking the file when it's open, so make sure it's closed before trying to access it with PHP. – ArtisticPhoenix Apr 24 '18 at 04:57
1 Answers
0
In the following $fileName
is a string with the full path to the file you want to know about. It's usually wise to check that any variable you plan to use is valid for the intended use.
if (is_file($filename))
{
$fileSize = filesize($filename);
}

DFriend
- 8,869
- 1
- 13
- 26