-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When dragging and dropping or selecting files, they are uploaded as a type that isn't allowed #14752
Comments
Hi there @Attackmonkey! Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better. We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.
We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
OK, in your example, you have Article (which also accepts PDFs) under the folder media type. If you remove that from the allowed media types, you'll see the issue. It should try and upload as the article type, even though it isn't allowed! So there shouldn't be either the new pdf upload or article allowed under folder! |
Hey again! Now I was able to reproduce the issue. The PDF should fall back to the generic file method as you mentioned, instead of providing the error |
Hi @Attackmonkey, We're writing to let you know that we would love some help with this issue. We feel that this issue is ideal to flag for a community member to work on it. Once flagged here, folk looking for issues to work on will know to look at yours. Of course, please feel free work on this yourself ;-). If there are any changes to this status, we'll be sure to let you know. For more information about issues and states, have a look at this blog post. Thanks muchly, from your friendly Umbraco GitHub bot :-) |
Working on it Edit: PR created |
Hi @Attackmonkey, We're writing to let you know that we would love some help with this issue. We feel that this issue is ideal to flag for a community member to work on it. Once flagged here, folk looking for issues to work on will know to look at yours. Of course, please feel free work on this yourself ;-). If there are any changes to this status, we'll be sure to let you know. For more information about issues and states, have a look at this blog post. Thanks muchly, from your friendly Umbraco GitHub bot :-) |
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.
The text was updated successfully, but these errors were encountered: