Copied to clipboard

Flag this post as spam?

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

  • Simon Hug 2 posts 72 karma points
    Jan 20, 2022 @ 18:48
    Simon Hug

    Configuration AllowedUploadFiles and ImageFileTypes with json

    I use Umbraco 9.2 and configure Umbraco using appsettings.json. I would like to limit the uploading of images and file types. I have followed the instructions(image) on this page, but it shows me a schema mism. The logic is not applied either. I can still upload other images and files.

    Does anyone know what I am doing wrong?

    Thanks for an answer enter image description here

  • Mark Drake 132 posts 453 karma points c-trib
    Jan 21, 2022 @ 04:01
    Mark Drake

    I believe the IntelliSense for this schema these come from here.

    When I hover over AllowedUploadFiles it tells me it's expecting a string value. Same error with ImageFileTypes.

    When searching through the source code, everything I find seems to expect an array of string values and gets converted to a string with commas as separators. (If I'm reading it correctly). Got no idea what's going on here.

    Update: I cannot get any version or combination of strings or arrays to work.

  • Simon Hug 2 posts 72 karma points
    Jan 21, 2022 @ 09:15
    Simon Hug

    Thanks for your analysis. Unfortunately, the combinations did not work for me either.

  • Mark Drake 132 posts 453 karma points c-trib
    Jan 21, 2022 @ 04:22
    Mark Drake

    Perhaps someone from HQ can validate the documentation and if it indeed matches how it should work. If so, then there needs to be a patch because it obviously isn't working. Then consider updating the schema so supported IDEs don't ask for a string when it needs an array of strings.

    The schema is part of this repo.

    I tried to test this with v9/contrib but while in debug mode, all file uploads failed. I'm not able to continue troubleshooting this.

  • Corné Strijkert 80 posts 454 karma points c-trib
    May 13, 2022 @ 07:29
    Corné Strijkert

    I experience the same problem on Umbraco 9.4.3. When I configure the 'Imaging.ImageFileTypes' as string or array, both don't disallow the not specified upload types.

    Does anybody have a update for this?

  • Ambert van Unen 169 posts 784 karma points c-trib
    Aug 04, 2022 @ 22:03
    Ambert van Unen

    Bit late perhaps, but perhaps for future readers this will come in handy: It seems that Imaging.ImageFileTypes setting is a static list of image extensions that Imageprocessor uses. So it's NOT an 'only allow these types of files' option.

    There doesn't seem be anything like this for Media types.

    However there is an option for Files: AllowedUploadFiles, although this seems to malfunction somehow as it doesnt read the value from the json. (10.0.1)

Please Sign in or register to post replies

Write your reply to: