diff --git a/file_entity.file_api.inc b/file_entity.file_api.inc
index effd2aa..bc19516 100644
--- a/file_entity.file_api.inc
+++ b/file_entity.file_api.inc
@@ -487,3 +487,47 @@ function file_uri_to_object($uri, $use_existing = TRUE) {
 
   return $file;
 }
+
+/**
+ *  Update an existing file type or create a new one.
+ *
+ *  @param object &$type
+ *    $type is an object with the following fields:
+ *      ->type => The machine name of the file type, such as 'video';
+ *      ->name => The human readable name;
+ *      ->description => A brief description of the file type;
+ *      ->mimetypes => An array of mimetypes supported by this file type.
+ *  @return void;
+ */
+function file_type_save(&$type) {
+  if (!isset($type->type) || empty($type->type)) {
+    throw new Exception(t('Unable to add file type, as its machine name is not provided.'));
+  }
+
+  if (!isset($type->mimetypes) || !is_array($type->mimetypes)) {
+    throw new Exception(t('File type mimetypes must be an array'));
+  }
+
+  db_merge('file_type')
+    ->key(array('type' => $type->type))
+    ->fields(array(
+      'name' => $type->name,
+      'description' => $type->description,
+    ))
+    ->execute();
+
+  db_delete('file_type_mimetypes')
+    ->condition('type', $type->type)
+    ->execute();
+
+  foreach ($type->mimetypes as $mimetype) {
+    db_insert('file_type_mimetypes')
+      ->fields(array('type' => $type->type, 'mimetype' => $mimetype))
+      ->execute();
+  }
+
+  // Clear the caches
+//  drupal_static_reset('media_type_get_types');
+//  drupal_static_reset('media_type_get_mime_map');
+  return;
+}
\ No newline at end of file
diff --git a/file_entity.install b/file_entity.install
index 3fe21a2..b268c7a 100644
--- a/file_entity.install
+++ b/file_entity.install
@@ -23,6 +23,11 @@ function file_entity_schema_alter(&$schema) {
  * Implements hook_schema().
  */
 function file_entity_schema() {
+   // Using this strange looking function name because of http://drupal.org/node/150220.
+  // Any changes to this table should happen after this line.
+  $schema['file_type'] = _file_entity_update_7105_schema_file_type();
+  $schema['file_type_mimetypes'] = _file_entity_update_7105_schema_file_type_mimetypes();
+
   $schema['file_display'] = array(
     'description' => 'Stores configuration options for file displays.',
     'fields' => array(
@@ -246,3 +251,72 @@ function file_entity_update_7104() {
     }
   }
 }
+
+// Using this strange looking function name because of http://drupal.org/node/150220.
+// This function should never be modified.
+function _file_entity_update_7105_schema_file_type() {
+  return array(
+    'description' => 'Stores the settings for file types.',
+    'fields' => array(
+      'type' => array(
+        'description' => 'The machine name of the file type.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'name' => array(
+        'description' => 'The human readable name of the file type.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+        'translatable' => TRUE,
+      ),
+      'description' => array(
+        'description' => 'A brief description of this file type.',
+        'type' => 'text',
+        'not null' => TRUE,
+        'size' => 'medium',
+        'translatable' => TRUE,
+      ),
+    ),
+    'primary key' => array('type'),
+  );
+}
+
+// Using this strange looking function name because of http://drupal.org/node/150220.
+// This function should never be modified.
+function _file_entity_update_7105_schema_file_type_mimetypes() {
+  return array(
+    'description' => 'Maps mimetypes to file types.',
+    'fields' => array(
+      'type' => array(
+        'description' => 'The machine name of the file type.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'mimetype' => array(
+        'description' => 'Mimetypes mapped to this file type.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+    ),
+    'indexes' => array(
+      array('file_type' => 'type'),
+      array('file_type_mimetype' => 'mimetype'),
+    ),
+  );
+}
+
+/**
+ * Add the file_type and file_type_mimetypes tables.
+ */
+function file_entity_update_7105() {
+  db_create_table('file_type', _file_entity_update_7105_schema_file_type());
+  db_create_table('file_type_mimetypes',  _file_entity_update_7105_schema_file_type_mimetypes());
+}
