From 0441827578eb3d27dcba2cd585771645e0957799 Mon Sep 17 00:00:00 2001 From: Claus Date: Thu, 3 Nov 2016 10:41:06 +0100 Subject: [PATCH] using the provided media type when uploading images, instead of using default Image media type. --- src/Umbraco.Web/Editors/MediaController.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Editors/MediaController.cs b/src/Umbraco.Web/Editors/MediaController.cs index 08140f9c66..41551d099d 100644 --- a/src/Umbraco.Web/Editors/MediaController.cs +++ b/src/Umbraco.Web/Editors/MediaController.cs @@ -532,7 +532,16 @@ namespace Umbraco.Web.Editors var mediaType = Constants.Conventions.MediaTypes.File; if (UmbracoConfig.For.UmbracoSettings().Content.ImageFileTypes.Contains(ext)) - mediaType = Constants.Conventions.MediaTypes.Image; + { + if (result.FormData.ContainsKey("contentTypeAlias")) + { + mediaType = result.FormData["contentTypeAlias"]; + } + else + { + mediaType = Constants.Conventions.MediaTypes.Image; + } + } //TODO: make the media item name "nice" since file names could be pretty ugly, we have // string extensions to do much of this but we'll need: