extending the media folder by adding custom validation
Hi Guys,
I was thinking of extending the media folder as our client requirement. Before uploading the media, we wanted to check the file size and the file size dimension.
I was thinking of adding it in the editMedia.aspx.cs before calling the _media.Save(); and then recompile the code.
Do you have any other suggestion that won't require me to recompile. Tim suggested to use the event model but i'm a little clueless on how to do it.
Recompiling the sourcecode is a bad thing to do,you can easy extend Umbraco with your custom datatypes/events etc. Anyway events is probably not the most flexible solution to add validation. The only thing a user sees is "Save got canceled bvy a third party component" .
What I would do is create a custom datatype and add the custom validation on that datatype.
You might want toc checkout these blogposts how to do this
extending the media folder by adding custom validation
Hi Guys,
I was thinking of extending the media folder as our client requirement. Before uploading the media, we wanted to check the file size and the file size dimension.
I was thinking of adding it in the editMedia.aspx.cs before calling the _media.Save(); and then recompile the code.
Do you have any other suggestion that won't require me to recompile. Tim suggested to use the event model but i'm a little clueless on how to do it.
Thanks,
Sherry
HI Sherry,
Recompiling the sourcecode is a bad thing to do,you can easy extend Umbraco with your custom datatypes/events etc. Anyway events is probably not the most flexible solution to add validation. The only thing a user sees is "Save got canceled bvy a third party component" .
What I would do is create a custom datatype and add the custom validation on that datatype.
You might want toc checkout these blogposts how to do this
http://www.nibble.be/?p=24
http://www.nibble.be/?p=97
Hope this helps you a bit.
Richard
is working on a reply...