Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
With all mimetypes included..this will also make upgrade path easier. Thoughts?
Comments
Comment #1
azinck CreditAttribution: azinck commentedI agree that we should create a new type to act as a catch-all. Application makes sense to me as providing an easier upgrade path, but perhaps the label should be "Other" because I don't think "Application" is as meaningful to most site admins.
I think we should add an option (maybe just a Drupal variable?) to select which type should act as a fallback. We might have to do a little trickery in file_type_delete() to ensure this variable is always pointing at a valid type (and the fact that types can be disabled my complicate matters, too). Regardless, if this can be made a simple variable then a simple change to file_get_type() to use that type if no other type is assigned should work easily enough.
The alternative approach would be to try to assign all mimetypes to our fallback file type but I think it's going to be too difficult to avoid having a given mimetype mapped to multiple types, which leads to the usually-undesirable step of forcing the user to select the desired file type for every upload.
Comment #2
azinck CreditAttribution: azinck commentedRelated: #1911970: The audio, image, and video file types should default to a wildcard mimetype selector
Comment #3
Dave ReidThe problem is once you assign a file a file type, you cannot convert it to another file type. This is just not something that I'd like to support.
Comment #4
digitgopher CreditAttribution: digitgopher commentedWhy don't you want to allow changing file types? I'm just curious as to the explanation. Seems like this could be useful.