-
-
Notifications
You must be signed in to change notification settings - Fork 166
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
Allow unknown file extensions to be selected in file open dialog #6263
Allow unknown file extensions to be selected in file open dialog #6263
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the changes. I think @lukasbestle should have the final review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the logic is awesome as a first step without breaking changes. Thanks! 👍
I'm really glad we were able to finally merge this. What a marathon :) Thanks for your patience and your contribution, Roman! |
This PR …
Resumes the work of #4344, but without merge conflicts.
It:
acceptAttribute
method in theFileBlueprint
class.acceptMime
method$matchWildcard
attribute to theKirby\Filesystem\Mime::toTemplates()
method.upload
field mixin and thefiles
section config to useacceptAttribute
instead ofacceptMime
.The new
acceptAttribute
function returns a list of extensions, instead of the list of mime types.The primary merit is that this allows files to be uploaded which are unknown to Kirby, but without forwading an all allowing
*
to the browser file open dialog. Because Kirby and the browser no longer need to know a mime type for those files.The modified
Mime::toTemplates
method can now produce an array of extensions also for a mime type likeimage/*
.Breaking changes
I'm not sure if the deprecation is a breaking change, in which case we could just not deprecate the no longer used
toMime()
method.Docs
acceptAttribute also has a clearer docblock which mentions how the list of file extensions is actually built:
The reproduces how acceptMime worked.
Ready?
I think so :)
For review team