Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Greetings, everyone.
I have a need to be able to reject media saving. Actual scenario depends on media type and properties, but I got the following test case.
I have created following binding in AppBase:
public class AppBase: umbraco.BusinessLogic.ApplicationBase { public AppBase() { Media.BeforeSave += (sender, e) => RejectMedia( sender, e ); } void RejectMedia(Media sender, SaveEventArgs e) { e.Cancel = true; }
It actually hits the "e.Cancel = true;" statement but media is still saved and seen Media section and on the actual website.
Did I miss some additional hooks?
Working with umbraco v 4.7.1 (Assembly version: 1.0.4281.20201)
I think you need to read this: http://www.aaron-powell.com/the-great-umbraco-api-misconception. You can't actually cancel it. I believe this will be changed in Umbraco 5.
Jeroen
Jeroen, thanks. I'll be looking for some other way around.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Cancelling save for media
Greetings, everyone.
I have a need to be able to reject media saving. Actual scenario depends on media type and properties, but I got the following test case.
I have created following binding in AppBase:
It actually hits the "e.Cancel = true;" statement but media is still saved and seen Media section and on the actual website.
Did I miss some additional hooks?
Working with umbraco v 4.7.1 (Assembly version: 1.0.4281.20201)
I think you need to read this: http://www.aaron-powell.com/the-great-umbraco-api-misconception. You can't actually cancel it. I believe this will be changed in Umbraco 5.
Jeroen
Jeroen, thanks. I'll be looking for some other way around.
is working on a reply...