There are a couple new mimetypes for Flash video files that we should recognize (flv). More information on these mimetypes can be found here.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drewish’s picture

looks good to me.

c960657’s picture

Status: Needs review » Needs work

According to Adobe, .f4a and .f4b should use audio/mp4.

drewish’s picture

Status: Needs work » Needs review
FileSize
1.06 KB

Here's a re-roll that takes c960657's data into account and a link to Adobe suggesting video/x-flv for .flv files.

Berdir’s picture

Subscribing, I need to update the hook_variable_info() patch when that gets in.

RobLoach’s picture

Status: Needs review » Reviewed & tested by the community

Applies 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....

Berdir’s picture

@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

Status: Reviewed & tested by the community » Needs work

The last submitted patch failed testing.

c960657’s picture

Status: Needs work » Needs review
FileSize
2.43 KB

I'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?

drewish’s picture

yeah #473652: file_get_mimetype() unneeded loop has kind of made a mess of this.

Dries’s picture

Status: Needs review » Fixed

Committed to CVS HEAD. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

mattgilbert’s picture

Is there a similar patch for Drupal 6? I think I'm having the same problem.

neilnz’s picture

Version: 7.x-dev » 6.x-dev
Status: Closed (fixed) » Needs review
FileSize
990 bytes

I'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.

c960657’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.