Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
10.5.1
Bug summary
It is possible to upload files in the media editor and have them created as the wrong kind of file type.
If you have an media type that accepts the PDF extension that ISN'T allowed under the current folder in the media library, the upload code attempts to create it as the media type that isn't allowed, throwing an error, rather than falling back to the generic File type.
Specifics
Error occurs in the media upload dashboard, it is caused by a bug in the file upload code I think. From looking at the code, it looks like it attempts to find the first media type that matches the file type, but it doesn't also check if that media type is allowed in the current upload location, causing "file type XXX is not allowed in this location" errors.
Steps to reproduce
Create a new file upload data type called "PDF Upload" that accepts the PDF file extension.
Create a new media type called "PDF File" that uses the PDF upload for the umbracoFile field. Make sure it is allowed at the root, but NOT underneath the media folder type.
Create a folder in your media library. Now try and drag and drop a PDF into the folder. Instead of using one if the allowed media types, the code matches to the "PDF File" media type, even though it's not allowed under the folder media type.
Expected result / actual result
As the PDF File type isn't allowed under the folder, it should fall back to the generic file media type, or any other media type that accepts PDFs that ARE allowed under the folder.
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
10.5.1
Bug summary
It is possible to upload files in the media editor and have them created as the wrong kind of file type.
If you have an media type that accepts the PDF extension that ISN'T allowed under the current folder in the media library, the upload code attempts to create it as the media type that isn't allowed, throwing an error, rather than falling back to the generic File type.
Specifics
Error occurs in the media upload dashboard, it is caused by a bug in the file upload code I think. From looking at the code, it looks like it attempts to find the first media type that matches the file type, but it doesn't also check if that media type is allowed in the current upload location, causing "file type XXX is not allowed in this location" errors.
Steps to reproduce
Create a new file upload data type called "PDF Upload" that accepts the PDF file extension.
Create a new media type called "PDF File" that uses the PDF upload for the umbracoFile field. Make sure it is allowed at the root, but NOT underneath the media folder type.
Create a folder in your media library. Now try and drag and drop a PDF into the folder. Instead of using one if the allowed media types, the code matches to the "PDF File" media type, even though it's not allowed under the folder media type.
Expected result / actual result
As the PDF File type isn't allowed under the folder, it should fall back to the generic file media type, or any other media type that accepts PDFs that ARE allowed under the folder.