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 120 posts 408 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 120 posts 408 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 451 karma points c-trib
    14 days ago
    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?

Please Sign in or register to post replies

Write your reply to:

Draft