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
I have created a custom media type and hooked in to the MediaService.Saving event.
When a file is uploaded I want to set the content type based on the file extension. How ever at that point Umbraco has already given media a content type.
public void Initialize()
MediaService.Saving += MediaService_Saving;
private void MediaService_Saving(IMediaService sender, SaveEventArgs<IMedia> e)
foreach (var mediaItem in e.SavedEntities)
var contentTypeAlias = mediaItem.ContentType.Alias;
How do I change the content type or hook in earlier to set the content type my self?
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted