Gargron / fileupload

PHP FileUpload library that supports chunked uploads
MIT License
460 stars 87 forks source link

New Validator --- Dimension validator #35

Closed adelowo closed 7 years ago

adelowo commented 7 years ago

This PR intoduces a new validator, DimensionValidator. With this you can validate files by their width and size.

This only works for images. If the uploaded file isn't an image, the validation would not pass.


$config = [
  'width' => '260',
  'height' => '400'
]; //can also use min_width, max_width, min_height and max_height.

$validator = new DimensionValidator($config); //you should check your namespace imports

$fileUpload->addValidator($validator);