Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
file system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
8 Feb 2009 at 07:17 UTC
Updated:
29 Apr 2010 at 00:54 UTC
Jump to comment: Most recent file
Comments
Comment #1
drewish commentedlooks good to me.
Comment #2
c960657 commentedAccording to Adobe, .f4a and .f4b should use audio/mp4.
Comment #3
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 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 commentedyeah #473652: file_get_mimetype() unneeded loop has kind of made a mess of this.
Comment #10
dries commentedCommitted to CVS HEAD. Thanks!
Comment #15
mattgilbert commentedIs there a similar patch for Drupal 6? I think I'm having the same problem.
Comment #16
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 commentedLooks good.
Comment #18
gábor hojtsyCommitted, thanks.