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
    0

    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 134 posts 458 karma points c-trib
    Jan 21, 2022 @ 04:01
    Mark Drake
    0

    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
    0

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

  • Mark Drake 134 posts 458 karma points c-trib
    Jan 21, 2022 @ 04:22
    Mark Drake
    0

    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 456 karma points c-trib
    May 13, 2022 @ 07:29
    Corné Strijkert
    0

    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 175 posts 818 karma points c-trib
    Aug 04, 2022 @ 22:03
    Ambert van Unen
    0

    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)

  • Gurumurthy 54 posts 127 karma points
    May 16, 2023 @ 07:22
    Gurumurthy
    0

    Hi All,

    Any solutions how to set ImageFileTypes in umbraco v11, I need to allow webp format images.

    Thanks.
    Gurumurthy J V

Please Sign in or register to post replies

Write your reply to:

Draft