How to define the size of uploaded images
How to define the size of uploaded images
kkuti
Posts: 20Questions: 6Answers: 0
Please how can I define the size of uploaded images. The upload is done quite easily but we need to define the width and height
Replies
Hi,
The server-side libraries for DataTables don't have a built in validator to check the height / width of an uploaded image. The built in validators are
Validate::fileExtensions()andValidate::fileSize().To check if an uploaded image's dimensions are within certain bounds, you need to use a custom validator. For example:
It might be an idea to pull that anonymous function out into a regular function that returns a closure if you are planning on using it for more than one field.
Allan