Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Fiona 16 posts 197 karma points
    Nov 07, 2022 @ 15:02
    Fiona
    0

    Drag and drop media not working: "the media type with alias 'Image' is not allowed here"

    Umbraco version: 8.18.4

    I have followed this documentation: https://our.umbraco.com/documentation/Fundamentals/Data/Creating-Media/ and I have created a new Image Cropper, new Media Type (which is a new type of image, just like the employee Image in the docs) and new Media Type folder.

    I have added the new folder to the Media section and now want to add images of the new media type to that folder. When I use the 'Create' function and select the new Media Type, it works fine. But when I drag and drop an image (jpg in this case), I get the error: Cannot upload this file, the media type with alias 'Image' is not allowed here. The error is correct, the alias Image is not allowed as child of the new Media Type folder, but why does it not recognize the new Media Type instead?

    How can I make this work? Should I add the new alias somewhere for it to be recognized as Image type?

  • Fiona 16 posts 197 karma points
    Nov 07, 2022 @ 16:15
    Fiona
    101

    Apperently it's a known issue: https://github.com/umbraco/Umbraco-CMS/pull/11858#issuecomment-1149731836 that is not getting fixed for v8. It seems the error pops up whenever you try to drag and drop an image (jpg or png) to a folder that allows other media types as child (even if the other types don't have the umbracoFile property).

    I've used jgettrup-ng's workaround, though it is far from ideal, especially cause the multi-folder drag and drop use case will fail if it contains any jpg/png files:

    I've removed the custom image media type as allowed child from the custom media folder and instead added an extra custom media folder that can only have the custom image media type as child.


    The Media tree ends up looking like this:

    • Custom media folder
      • PDF, SVG, docx etc.
      • Custom image folder
        • Custom images (jpg, png)
Please Sign in or register to post replies

Write your reply to:

Draft