getSize() public method

Get file size
Requires '\Webiny\Component\Storage\Driver\SizeAwareInterface' to be implemented by a Driver class
public getSize ( string $key ) : integer | boolean
$key string
return integer | boolean The size of the file in bytes or false
Example #1
0
 /**
  * Get file size in bytes
  *
  * @return int|null Number of bytes or null
  */
 public function getSize()
 {
     if ($this->size === null && $this->storage->supportsSize()) {
         $this->size = $this->storage->getSize($this->key);
     }
     return $this->size;
 }