jstewmc/validate-file-size

Validate a file's size

Installs: 19

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

pkg:composer/jstewmc/validate-file-size

v0.1.0 2016-08-26 03:10 UTC

This package is auto-updated.

Last update: 2025-09-29 01:46:57 UTC


README

Validate a file's size.

use Jstewmc\ValidateFileSize\Validate;

// set the file's name
$filename = '/path/to/foo.php';

// create a three-byte file
file_put_contents($filename, 'foo');

// check the file's size
(new Validate(0, 1))($filename);    // returns false
(new Validate(0, 999))($filename);  // returns true

Keep in mind, the min and max sizes are inclusive.

That's about it!

Author

Jack Clayton

License

MIT

Version

0.1.0, August 24, 2017

  • Initial release