-
Notifications
You must be signed in to change notification settings - Fork 2
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 specifying the error message for disallowed mimeTypes #12
Comments
Implemented in https://github.com/darinda/NetgenEnhancedBinaryFileBundle/commit/826f21b3ff27ea3bae214926024b8d7ee2447a13 |
@darinda, please create PR based on the code from your fork. Just one notice, maybe a better solution would be to use |
@MarioBlazek PR has been created. I moved the mimeTypeMessage to the database because it can be translated there. ContentTypes can be translated, so i think this is the correct place to put them. That way the mimeTypeMessage can be specified like "Please upload only PDF documents!" instead of having the standard symfony message stating something about the mime types which a normal end user won't be able to understand. |
Hm, that might make sense. What happens if we leave it to an empty value? |
Then symfony's default error message will be displayed, as it was before this pull request. So |
@emodric bump ;) |
I've left a couple of comments on #13. Otherwise, if everything works, I'm +1 for merging. @MarioBlazek What do you think? |
Symfony allows for specifying the error message that will be shown when the user selects a file of a mime type that is disallowed (https://symfony.com/doc/current/reference/constraints/File.html#mimetypesmessage)
It would be nice to be able to define that error message on content type level in the admin interface.
The text was updated successfully, but these errors were encountered: