0
votes

I want to run some custom code when a media item is saved, but there doesn't seem to be a media item save pipeline. We aren't trying to change the item in anyway what so ever - we just want to run some custom code when a media item gets saved. Google mentioned the Sitecore.Resources.Media.MediaProvider but I read that this cannot be overridden. Does anyone know of a pipeline or custom processor we can override that is fired when a media item is saved?

I am running Sitecore 6.5 rev 120706.

Cheers

1

1 Answers

4
votes

A MediaItem inherits from a CustomItemBase class. The CustomItemBase class also uses the item:saved event so you can create a custom event to handle your custom code.

A quick way to check if you are dealing with a mediaItem:

if (myItem.Paths.IsMediaItem)
{
  // your custom code
}