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.
There are a couple new mimetypes for Flash video files that we should recognize (flv). More information on these mimetypes can be found here.
Comment | File | Size | Author |
---|---|---|---|
#16 | file.inc_.flv_.d6.patch | 990 bytes | neilnz |
#8 | flv-1.patch | 2.43 KB | c960657 |
#3 | file_370958.patch | 1.06 KB | drewish |
flvmimetype.patch | 681 bytes | RobLoach | |
Comments
Comment #1
drewish CreditAttribution: drewish commentedlooks good to me.
Comment #2
c960657 CreditAttribution: c960657 commentedAccording to Adobe, .f4a and .f4b should use audio/mp4.
Comment #3
drewish CreditAttribution: drewish commentedHere's a re-roll that takes c960657's data into account and a link to Adobe suggesting video/x-flv for .flv files.
Comment #4
BerdirSubscribing, I need to update the hook_variable_info() patch when that gets in.
Comment #5
RobLoachApplies cleanly, RTBC.
Any thoughts on an additional hook_file_mimetypes() so that new mimetypes can be added via contrib? I suppose once hook_variable_info() and hook_variable_info_alter() are in, this would be easy to change....
Comment #6
Berdir@Rob Loach
a idea that was mentioned in the hook_variable_info() issue was to create a table to store these. I've also seen that there is work for a file.module, it could even provide a interface to add additional mimetypes. Or a contrib module could do it.
Some advantages such a table would imho have:
- Better handling of large amount of entries, does need less memory
- Doesn't need to be cached/saved in the variables table as a big blob
- Possibilites to manage the mime types and create a UI to manage the mimetypes
- We could simply reference to that table, instead of storing the mimetype for each file entry
Comment #8
c960657 CreditAttribution: c960657 commentedI'm not sure what the best way is to add new MIME-types to file_default_mimetype_mapping().
I'd rather not renumber all the existing types - this makes it harder to review the patch and follow the CVS history. This leaves the options of keeping either the numerical order of the ids or the alphabetical order of the MIME-types. I think the latter gives the best overview of related types, because e.g. all image/* types are displayed in one block.
Thoughts?
Comment #9
drewish CreditAttribution: drewish commentedyeah #473652: file_get_mimetype() unneeded loop has kind of made a mess of this.
Comment #10
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks!
Comment #15
mattgilbert CreditAttribution: mattgilbert commentedIs there a similar patch for Drupal 6? I think I'm having the same problem.
Comment #16
neilnz CreditAttribution: neilnz commentedI've backported the patch from #8 to Drupal 6.
For Googling reference, you need this patch if Filefield + mimedetect is giving you something like "The selected file test2.flv could not be uploaded. The file contents (video/x-flv) do not match its extension (flv)."
Patch is against current DRUPAL-6 branch.
Comment #17
c960657 CreditAttribution: c960657 commentedLooks good.
Comment #18
Gábor HojtsyCommitted, thanks.