Hi Toko,
Thank you for contacting us.
Query 1: would like to validate my images before uploading. the images, therefore, the dimmensions are greater than (height 400px and width 500px) are resized at (height 400px and width 500px)
You can achieve this query by using the below UG Documentation. Please find the UG Documentation link
Query 2: those with dimensions less than (height 400px and width 500px) are rejected
As per your requirement, we have abort the those files with the specified height and width. Please find the below code snippet
[index.js]
onUpload(args){
var flag = false;
var image = new Image();
image.src = window.URL.createObjectURL(args.fileData.rawFile);
image.onload = function () {
if (this.naturalHeight < 300 && this.naturalWidth < 375) {
flag = true;
}
if (flag) {
args.currentRequest.abort()
}
}
} |
Let us know if you need any further assistance on this.
Regards,
Prince