0

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.

rhog23
  • 311
  • 2
  • 16
  • 2
    does not mater how the file was created: https://secure.php.net/manual/en/function.filesize.php –  Apr 24 '18 at 04:55
  • 2
    have 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 Answers1

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);
}

RTM

DFriend
  • 8,869
  • 1
  • 13
  • 26