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.
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.
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.
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.
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)
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
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 withImageFileTypes
.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.
Thanks for your analysis. Unfortunately, the combinations did not work for me either.
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.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?
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)
Hi All,
Any solutions how to set ImageFileTypes in umbraco v11, I need to allow webp format images.
Thanks.
Gurumurthy J V
is working on a reply...