I guess it should be possible to hook into the BeforeSave event and check the file size of the file uploaded and cancel it if it ecxeeds the limit specified. I must admit that I'm not able to provide you with any sample code for this...but maybe some others in here are :)
Is there a way to validate the image size and dimension?
Can anybody help me how to add the validation?
Hi Sherry
Where do you want to add the validation?
I guess you could make a check using XSLT to see if the width and height match the required values then it's inserted, otherwise it's not.
You could also use imageGen to ensure images are scaled to fit the proper dimensions perhaps?
Please tell us a bit more about what you have on your mind.
/Jan
Hi Jan,
I want to validate it during upload. When I clicked on the save button it should not proceed once it detects the image size is more than 120kb.
Hi Sherry
I guess it should be possible to hook into the BeforeSave event and check the file size of the file uploaded and cancel it if it ecxeeds the limit specified. I must admit that I'm not able to provide you with any sample code for this...but maybe some others in here are :)
/Jan
But I can't find the BeforeSave event in the data editor. There is only OnSave event.
I was trying to add a validator also but I have no idea how to hook it up the label control that is used in media.
is working on a reply...