diff --git a/modules/node_export_feeds/FeedsNodeExportParser.inc b/modules/node_export_feeds/FeedsNodeExportParser.inc
diff --git a/modules/node_export_feeds/FeedsNodeExportProcessor.inc b/modules/node_export_feeds/FeedsNodeExportProcessor.inc
diff --git a/modules/node_export_file/node_export_file.info b/modules/node_export_file/node_export_file.info
deleted file mode 100755
index fd4191d..0000000
--- a/modules/node_export_file/node_export_file.info
+++ /dev/null
@@ -1,5 +0,0 @@
-name = Node export file
-description = "Export helper module for handling file fields."
-dependencies[] = node_export
-core = 7.x
-package = "Node export"
\ No newline at end of file
diff --git a/modules/node_export_file/node_export_file.install b/modules/node_export_file/node_export_file.install
deleted file mode 100755
index 040dedd..0000000
--- a/modules/node_export_file/node_export_file.install
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-/**
- * @file
- * The Node export file install file.
- */
-
-/**
- * Implements hook_install().
- *
- * @todo
- *  Why is this weighting required, and how can we replace it with
- *  hook_module_implements_alter() ?
- * -- I don't think it's used because the only hooks invoked by node_export_file
- * are hooks from node_export, nothing CCK modules would call?
- */
-/*
-function node_export_file_install() {
-  // Weight the module light to ensure it runs before all CCK modules
-  db_update('system')
-    ->fields(array('weight' => -10))
-    ->condition('name', 'node_export_file')
-    ->execute();
-}
-*/
-
-/**
- * Implementation of hook_uninstall().
- */
-function node_export_file_uninstall() {
-  variable_del('node_export_file_types');
-  variable_del('node_export_file_mode');
-  variable_del('node_export_file_assets_path');
-}
diff --git a/modules/node_export_file/node_export_file.module b/modules/node_export_file/node_export_file.module
deleted file mode 100755
index f098516..0000000
--- a/modules/node_export_file/node_export_file.module
+++ /dev/null
@@ -1,326 +0,0 @@
-<?php
-
-/**
- * @file
- * The Node export file module.
- *
- * Export helper module for handling file fields.
- */
-
-/**
- * Implements hook_form_FORM_ID_alter().
- */
-function node_export_file_form_node_export_settings_alter(&$form, &$form_state, $form_id) {
-  $form['file'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('File fields'),
-  );
-
-  $types = node_type_get_names();
-  $form['file']['node_export_file_types'] = array(
-    '#type' => 'checkboxes',
-    '#title' => t('Files exported for content types'),
-    '#default_value' => variable_get('node_export_file_types', array()),
-    '#options' => $types,
-    '#description' => t('Which content types should export file fields?'),
-  );
-
-  $textarea_delivery = $form['basic']['node_export_code']['#default_value'];
-
-  $mode_message_display = ($textarea_delivery != 'file');
-
-  $form['file']['node_export_file_mode'] = array(
-    '#type' => 'radios',
-    '#title' => t('File export mode'),
-    '#default_value' => variable_get('node_export_file_mode', 'inline'),
-    '#options' => array(
-      'inline' => t('Inline Base64'),
-      'local' => t('Local file export'),
-      'remote' => t('Remote file export, URL')
-     ),
-    '#description' => t('Should file exports be inline inside the export code, a local path to the file, or a URL?  Inline Base64 is the easiest option to use but can sometimes exceed PHP post limits, local and remote modes are more useful for power users.  <em>NOTE: Remote mode only works with a public files directory.</em>'),
-  );
-
-  $form['file']['node_export_file_assets_path'] = array(
-    '#type' => 'textfield',
-    '#title' => t('Export FileField assets path'),
-    '#size' => 60,
-    '#maxlength' => 255,
-    '#default_value' => variable_get('node_export_file_assets_path', ''),
-    '#description' => t(
-      'Optionally, copy files to this path when the node is exported.
-      The primary advantage of this is to divert exported files into a
-      safe location so they can be commmitted to source control (eg: Subversion,
-      CVS, git).  <em>Tip: For install profile developers, setting this
-      path to <code>profiles/my_profile/node_export_assets</code> may be
-      useful.</em>'
-    ),
-    '#required' => FALSE,
-    '#states' => array(
-      'visible' => array(
-        ':input[name=node_export_file_mode]' => array('value' => 'local'),
-      ),
-    ),
-  );
-
-}
-
-/**
- * Implements hook_node_export_node_alter().
- */
-function node_export_file_node_export_node_alter(&$node, $original_node) {
-  $types = array_filter(variable_get('node_export_file_types', array()));
-  if (in_array($node->type, $types)) {
-    $assets_path = variable_get('node_export_file_assets_path', '');
-    $export_mode = variable_get('node_export_file_mode', 'inline');
-
-    switch ($export_mode) {
-      case 'local':
-        $export_var = 'node_export_file_path';
-        break;
-      case 'remote':
-        $export_var = 'node_export_file_url';
-        break;
-      default:
-      case 'inline':
-        $export_var = 'node_export_file_data';
-        break;
-    }
-
-    // If files are supposed to be copied to the assets path.
-    if ($export_mode == 'local' && $assets_path) {
-      // Ensure the assets path is created
-      if (!is_dir($assets_path) && mkdir($assets_path, 0777, TRUE) == FALSE) {
-        drupal_set_message(t("Could not create assets path! '!path'", array('!path' => $assets_path)), 'error');
-        // Don't continue if the assets path is not ready
-        return;
-      }
-
-      // Ensure it is writable
-      if (!is_writable($assets_path)) {
-        drupal_set_message(t("Assets path is not writable! '!path'", array('!path' => $assets_path)), 'error');
-        // Don't continue if the assets path is not ready
-        return;
-      }
-    }
-
-    // get all fields from this node type
-    $fields = field_info_instances('node', $node->type);
-    foreach($fields as $field_instance) {
-
-      // load field infos to check the type
-      $field = &$node->{$field_instance['field_name']};
-      $info = field_info_field($field_instance['field_name']);
-
-      // check if this field should implement file import/export system
-      if (in_array($info['type'], array("image", "file"))) {
-
-        // we need to loop into each language because i18n translation can build
-        // fields with different language than the node one.
-        foreach($field as $language => $files) {
-          if (is_array($files)) {
-            foreach($files as $i => $file) {
-
-              // convert file to array to stay into the default node_export_file format
-              $file = (object) $file;
-
-              // Check the file
-              if (!isset($file->uri) || !is_file($file->uri)) {
-                drupal_set_message(t("File field found on node, but file doesn't exist on disk? '!path'", array('!path' => $file->uri)), 'error');
-                continue;
-              }
-
-              if ($export_mode == 'local') {
-                if ($assets_path) {
-                  $export_data = $assets_path . '/' . basename($file->uri);
-                  if (!copy($file->uri, $export_data)) {
-                    drupal_set_message(t("Export file error, could not copy '%filepath' to '%exportpath'.", array('%filepath' => $file->uri, '%exportpath' => $export_data)), 'error');
-                    return FALSE;
-                  }
-                }
-                else {
-                  $export_data = $file->uri;
-                }
-              }
-              // Remote export mode
-              elseif ($export_mode == 'remote') {
-                $export_data = url($file->uri, array('absolute' => TRUE));
-              }
-              // Default is 'inline' export mode
-              else {
-                $export_data = base64_encode(file_get_contents($file->uri));
-              }
-
-              // build the field again, and remove fid to be sure that imported node
-              // will rebuild the file again, or keep an existing one with a different fid
-              $field[$language][$i]['fid'] = NULL;
-              $field[$language][$i][$export_var] = $export_data;
-
-            }
-          }
-        }
-      }
-    }
-  }
-}
-
-/**
- * Implements hook_node_export_node_import_alter().
- */
-function node_export_file_node_export_node_import_alter(&$node, $original_node) {
-  // Get all fields from this node type.
-  $fields = field_info_instances('node', $node->type);
-  foreach($fields as $field_instance) {
-
-    // Load field info to check the type.
-    $field = &$node->{$field_instance['field_name']};
-    $info = field_info_field($field_instance['field_name']);
-
-    // Check if this field should implement file import/export system.
-    if (in_array($info['type'], array("image", "file"))) {
-
-      // We need to loop into each language because i18n translation can build
-      // fields with different language than the node one.
-      foreach($field as $language => $files) {
-        if (is_array($files)) {
-          foreach($files as $i => $file) {
-
-            // Convert file to array to stay into the default node_export_file format.
-            $file = (object)$file;
-
-            $result = node_export_file_import_file($file);
-            // The file was saved successfully, update the file field (by reference).
-            if ($result == TRUE && isset($file->fid)) {
-              $field[$language][$i] = (array)$file;
-            }
-
-          }
-        }
-      }
-    }
-  }
-}
-
-/**
- * Detects remote and local file exports and imports accordingly.
- *
- * @param &$file
- *   The file, passed by reference.
- * @return TRUE or FALSE
- *   Depending on success or failure.  On success the $file object will
- *   have a valid $file->fid attribute.
- */
-function node_export_file_import_file(&$file) {
-  // This is here for historical reasons to support older exports.  It can be
-  // removed in the next major version.
-  $file->uri = strtr($file->uri, array('#FILES_DIRECTORY_PATH#' => 'public:/'));
-
-  // The file is already in the right location AND either the
-  // node_export_file_path is not set or the node_export_file_path and filepath
-  // contain the same file
-  if (is_file($file->uri) &&
-    (
-      (!isset($file->node_export_file_path) || !is_file($file->node_export_file_path)) ||
-      (
-        is_file($file->node_export_file_path) &&
-        filesize($file->uri) == filesize($file->node_export_file_path) &&
-        strtoupper(dechex(crc32(file_get_contents($file->uri)))) ==
-          strtoupper(dechex(crc32(file_get_contents($file->node_export_file_path))))
-      )
-    )
-  ) {
-    // Keep existing file if it exists already at this uri (see also #1023254)
-    // Issue #1058750.
-    $query = db_select('file_managed', 'f')
-        ->fields('f', array('fid'))
-        ->condition('uri', $file->uri)
-        ->execute()
-        ->fetchCol();
-
-    if (!empty($query)) {
-      watchdog('node_export_file_import_file', 'kept existing managed file at uri "%uri"', array('%uri' => $file->uri), WATCHDOG_NOTICE);
-      $file = file_load(array_shift($query));
-    }
-
-    $file = file_save($file);
-  }
-  elseif (isset($file->node_export_file_data)) {
-    $directory = drupal_dirname($file->uri);
-    if (file_prepare_directory($directory, FILE_CREATE_DIRECTORY)) {
-      if (file_put_contents($file->uri, base64_decode($file->node_export_file_data))) {
-        $file = file_save($file);
-      }
-    }
-  }
-  // The file is in a local location, move it to the
-  // destination then finish the save
-  elseif (isset($file->node_export_file_path) && is_file($file->node_export_file_path)) {
-    $directory = drupal_dirname($file->uri);
-    if (file_prepare_directory($directory, FILE_CREATE_DIRECTORY)) {
-      // The $file->node_export_file_path is passed to reference, and modified
-      // by file_unmanaged_copy().  Making a copy to avoid tainting the original.
-      $node_export_file_path = $file->node_export_file_path;
-      file_unmanaged_copy($node_export_file_path, $directory, FILE_EXISTS_REPLACE);
-
-      // At this point the $file->node_export_file_path will contain the
-      // destination of the copied file
-      //$file->uri = $node_export_file_path;
-      $file = file_save($file);
-    }
-  }
-  // The file is in a remote location, attempt to download it
-  elseif (isset($file->node_export_file_url)) {
-    // Need time to do the download
-    ini_set('max_execution_time', 900);
-
-    $temp_path = file_directory_temp() . '/' . md5(mt_rand()) . '.txt';
-    if (($source = fopen($file->node_export_file_url, 'r')) == FALSE) {
-      drupal_set_message(t("Could not open '@file' for reading.", array('@file' => $file->node_export_file_url)));
-      return FALSE;
-    }
-    elseif (($dest = fopen($temp_path, 'w')) == FALSE) {
-      drupal_set_message(t("Could not open '@file' for writing.", array('@file' => $file->uri)));
-      return FALSE;
-    }
-    else {
-      // PHP5 specific, downloads the file and does buffering
-      // automatically.
-      $bytes_read = @stream_copy_to_stream($source, $dest);
-
-      // Flush all buffers and wipe the file statistics cache
-      @fflush($source);
-      @fflush($dest);
-      clearstatcache();
-
-      if ($bytes_read != filesize($temp_path)) {
-        drupal_set_message(t("Remote export '!url' could not be fully downloaded, '@file' to temporary location '!temp'.", array('!url' => $file->node_export_file_url, '@file' => $file->uri, '!temp' => $temp_path)));
-        return FALSE;
-      }
-      // File was downloaded successfully!
-      else {
-        if (!@copy($temp_path, $file->uri)) {
-          unlink($temp_path);
-          drupal_set_message(t("Could not move temporary file '@temp' to '@file'.", array('@temp' => $temp_path, '@file' => $file->uri)));
-          return FALSE;
-        }
-
-        unlink($temp_path);
-        $file->filesize = filesize($file->uri);
-        $file->filemime = file_get_mimetype($file->uri);
-      }
-    }
-
-    fclose($source);
-    fclose($dest);
-
-    $file = file_save($file);
-  }
-  // Unknown error
-  else {
-    drupal_set_message(t("Unknown error occurred attempting to import file: @filepath", array('@filepath' => $file->uri)), 'error');
-    return FALSE;
-  }
-
-  return TRUE;
-}
-
diff --git a/modules/node_export_relation/node_export_relation.node_reference.inc b/modules/node_export_relation/node_export_relation.node_reference.inc
diff --git a/modules/node_export_relation/node_export_relation.og.inc b/modules/node_export_relation/node_export_relation.og.inc
diff --git a/modules/node_export_relation/node_export_relation.taxonomy.inc b/modules/node_export_relation/node_export_relation.taxonomy.inc
diff --git a/node_export.drush.inc b/node_export.drush.inc
diff --git a/node_export.install b/node_export.install
index f918c92..645ff7d 100755
--- a/node_export.install
+++ b/node_export.install
@@ -22,6 +22,9 @@ function node_export_uninstall() {
     variable_del('node_export_reset_path_' . $type);
     variable_del('node_export_reset_book_mlid_' . $type);
   }
+  variable_del('node_export_file_types');
+  variable_del('node_export_file_mode');
+  variable_del('node_export_file_assets_path');
 
   // Old variables.
   variable_del('node_export_method');
@@ -31,11 +34,7 @@ function node_export_uninstall() {
 }
 
 /**
- * Implements hook_update_N().
- *
  * Warn user about changed permissions and configuration.
- *
- * @see hook_update_N()
  */
 function node_export_update_7300() {
   drupal_set_message(
@@ -62,4 +61,16 @@ function node_export_update_7300() {
     'warning'
   );
   return 'Note: Please update Node export permissions and configuration.';
+}
+
+/**
+ * Combine Node export file module directly into Node export.
+ */
+function node_export_update_7301() {
+  // Upgraders with node_export_file should have the module disabled.
+  if (module_exists('node_export_file')) {
+    drupal_set_message('<em>Node export file</em> is deprecated.  Please delete the ' . drupal_get_path('module', 'node_export_file') . ' directory from the Drupal installation.', 'warning');
+    module_disable(array('node_export_file'), FALSE);
+  }
+  return 'Node export file removed, functionality moved to Node export.';
 }
\ No newline at end of file
diff --git a/node_export.module b/node_export.module
index c48aba5..192e3c9 100755
--- a/node_export.module
+++ b/node_export.module
@@ -386,6 +386,9 @@ function node_export_prepare_node(&$original_node) {
   // Add a parameter to identify this node as coming from D7, might be useful some day.
   $node->node_export_drupal_version = '7';
 
+  // Export file fields.
+  node_export_file_field_export($node, $original_node);
+
   // Let other modules do special fixing up.
   drupal_alter('node_export_node', $node, $original_node);
 
@@ -511,6 +514,9 @@ function node_export_import($code_string, $msg_t = 't', $save = TRUE) {
   foreach ($nodes as $original_node) {
     $node = node_export_node_clone($original_node);
 
+    // Import file fields.
+    node_export_file_field_import($node, $original_node);
+
     // Let other modules do special fixing up.
     drupal_alter('node_export_node_import', $node, $original_node, $save);
 
@@ -868,6 +874,266 @@ function node_export_format_handlers() {
   return $format_handlers;
 }
 
+
+/**
+ * Handle exporting file fields.
+ */
+function node_export_file_field_export(&$node, $original_node) {
+  $types = array_filter(variable_get('node_export_file_types', array()));
+  if (in_array($node->type, $types)) {
+    $assets_path = variable_get('node_export_file_assets_path', '');
+    $export_mode = variable_get('node_export_file_mode', 'inline');
+
+    switch ($export_mode) {
+      case 'local':
+        $export_var = 'node_export_file_path';
+        break;
+      case 'remote':
+        $export_var = 'node_export_file_url';
+        break;
+      default:
+      case 'inline':
+        $export_var = 'node_export_file_data';
+        break;
+    }
+
+    // If files are supposed to be copied to the assets path.
+    if ($export_mode == 'local' && $assets_path) {
+      // Ensure the assets path is created
+      if (!is_dir($assets_path) && mkdir($assets_path, 0777, TRUE) == FALSE) {
+        drupal_set_message(t("Could not create assets path! '!path'", array('!path' => $assets_path)), 'error');
+        // Don't continue if the assets path is not ready
+        return;
+      }
+
+      // Ensure it is writable
+      if (!is_writable($assets_path)) {
+        drupal_set_message(t("Assets path is not writable! '!path'", array('!path' => $assets_path)), 'error');
+        // Don't continue if the assets path is not ready
+        return;
+      }
+    }
+
+    // get all fields from this node type
+    $fields = field_info_instances('node', $node->type);
+    foreach($fields as $field_instance) {
+
+      // load field infos to check the type
+      $field = &$node->{$field_instance['field_name']};
+      $info = field_info_field($field_instance['field_name']);
+
+      // check if this field should implement file import/export system
+      if (in_array($info['type'], array("image", "file"))) {
+
+        // we need to loop into each language because i18n translation can build
+        // fields with different language than the node one.
+        foreach($field as $language => $files) {
+          if (is_array($files)) {
+            foreach($files as $i => $file) {
+
+              // convert file to array to stay into the default node_export_file format
+              $file = (object) $file;
+
+              // Check the file
+              if (!isset($file->uri) || !is_file($file->uri)) {
+                drupal_set_message(t("File field found on node, but file doesn't exist on disk? '!path'", array('!path' => $file->uri)), 'error');
+                continue;
+              }
+
+              if ($export_mode == 'local') {
+                if ($assets_path) {
+                  $export_data = $assets_path . '/' . basename($file->uri);
+                  if (!copy($file->uri, $export_data)) {
+                    drupal_set_message(t("Export file error, could not copy '%filepath' to '%exportpath'.", array('%filepath' => $file->uri, '%exportpath' => $export_data)), 'error');
+                    return FALSE;
+                  }
+                }
+                else {
+                  $export_data = $file->uri;
+                }
+              }
+              // Remote export mode
+              elseif ($export_mode == 'remote') {
+                $export_data = url($file->uri, array('absolute' => TRUE));
+              }
+              // Default is 'inline' export mode
+              else {
+                $export_data = base64_encode(file_get_contents($file->uri));
+              }
+
+              // build the field again, and remove fid to be sure that imported node
+              // will rebuild the file again, or keep an existing one with a different fid
+              $field[$language][$i]['fid'] = NULL;
+              $field[$language][$i][$export_var] = $export_data;
+
+            }
+          }
+        }
+      }
+    }
+  }
+}
+
+/**
+ * Handle importing file fields.
+ */
+function node_export_file_field_import(&$node, $original_node) {
+  // Get all fields from this node type.
+  $fields = field_info_instances('node', $node->type);
+  foreach($fields as $field_instance) {
+
+    // Load field info to check the type.
+    $field = &$node->{$field_instance['field_name']};
+    $info = field_info_field($field_instance['field_name']);
+
+    // Check if this field should implement file import/export system.
+    if (in_array($info['type'], array("image", "file"))) {
+
+      // We need to loop into each language because i18n translation can build
+      // fields with different language than the node one.
+      foreach($field as $language => $files) {
+        if (is_array($files)) {
+          foreach($files as $i => $file) {
+
+            // Convert file to array to stay into the default node_export_file format.
+            $file = (object)$file;
+
+            $result = _node_export_file_field_import_file($file);
+            // The file was saved successfully, update the file field (by reference).
+            if ($result == TRUE && isset($file->fid)) {
+              $field[$language][$i] = (array)$file;
+            }
+
+          }
+        }
+      }
+    }
+  }
+}
+
+/**
+ * Detects remote and local file exports and imports accordingly.
+ *
+ * @param &$file
+ *   The file, passed by reference.
+ * @return TRUE or FALSE
+ *   Depending on success or failure.  On success the $file object will
+ *   have a valid $file->fid attribute.
+ */
+function _node_export_file_field_import_file(&$file) {
+  // This is here for historical reasons to support older exports.  It can be
+  // removed in the next major version.
+  $file->uri = strtr($file->uri, array('#FILES_DIRECTORY_PATH#' => 'public:/'));
+
+  // The file is already in the right location AND either the
+  // node_export_file_path is not set or the node_export_file_path and filepath
+  // contain the same file
+  if (is_file($file->uri) &&
+    (
+      (!isset($file->node_export_file_path) || !is_file($file->node_export_file_path)) ||
+      (
+        is_file($file->node_export_file_path) &&
+        filesize($file->uri) == filesize($file->node_export_file_path) &&
+        strtoupper(dechex(crc32(file_get_contents($file->uri)))) ==
+          strtoupper(dechex(crc32(file_get_contents($file->node_export_file_path))))
+      )
+    )
+  ) {
+    // Keep existing file if it exists already at this uri (see also #1023254)
+    // Issue #1058750.
+    $query = db_select('file_managed', 'f')
+        ->fields('f', array('fid'))
+        ->condition('uri', $file->uri)
+        ->execute()
+        ->fetchCol();
+
+    if (!empty($query)) {
+      watchdog('node_export', 'kept existing managed file at uri "%uri"', array('%uri' => $file->uri), WATCHDOG_NOTICE);
+      $file = file_load(array_shift($query));
+    }
+
+    $file = file_save($file);
+  }
+  elseif (isset($file->node_export_file_data)) {
+    $directory = drupal_dirname($file->uri);
+    if (file_prepare_directory($directory, FILE_CREATE_DIRECTORY)) {
+      if (file_put_contents($file->uri, base64_decode($file->node_export_file_data))) {
+        $file = file_save($file);
+      }
+    }
+  }
+  // The file is in a local location, move it to the
+  // destination then finish the save
+  elseif (isset($file->node_export_file_path) && is_file($file->node_export_file_path)) {
+    $directory = drupal_dirname($file->uri);
+    if (file_prepare_directory($directory, FILE_CREATE_DIRECTORY)) {
+      // The $file->node_export_file_path is passed to reference, and modified
+      // by file_unmanaged_copy().  Making a copy to avoid tainting the original.
+      $node_export_file_path = $file->node_export_file_path;
+      file_unmanaged_copy($node_export_file_path, $directory, FILE_EXISTS_REPLACE);
+
+      // At this point the $file->node_export_file_path will contain the
+      // destination of the copied file
+      //$file->uri = $node_export_file_path;
+      $file = file_save($file);
+    }
+  }
+  // The file is in a remote location, attempt to download it
+  elseif (isset($file->node_export_file_url)) {
+    // Need time to do the download
+    ini_set('max_execution_time', 900);
+
+    $temp_path = file_directory_temp() . '/' . md5(mt_rand()) . '.txt';
+    if (($source = fopen($file->node_export_file_url, 'r')) == FALSE) {
+      drupal_set_message(t("Could not open '@file' for reading.", array('@file' => $file->node_export_file_url)));
+      return FALSE;
+    }
+    elseif (($dest = fopen($temp_path, 'w')) == FALSE) {
+      drupal_set_message(t("Could not open '@file' for writing.", array('@file' => $file->uri)));
+      return FALSE;
+    }
+    else {
+      // PHP5 specific, downloads the file and does buffering
+      // automatically.
+      $bytes_read = @stream_copy_to_stream($source, $dest);
+
+      // Flush all buffers and wipe the file statistics cache
+      @fflush($source);
+      @fflush($dest);
+      clearstatcache();
+
+      if ($bytes_read != filesize($temp_path)) {
+        drupal_set_message(t("Remote export '!url' could not be fully downloaded, '@file' to temporary location '!temp'.", array('!url' => $file->node_export_file_url, '@file' => $file->uri, '!temp' => $temp_path)));
+        return FALSE;
+      }
+      // File was downloaded successfully!
+      else {
+        if (!@copy($temp_path, $file->uri)) {
+          unlink($temp_path);
+          drupal_set_message(t("Could not move temporary file '@temp' to '@file'.", array('@temp' => $temp_path, '@file' => $file->uri)));
+          return FALSE;
+        }
+
+        unlink($temp_path);
+        $file->filesize = filesize($file->uri);
+        $file->filemime = file_get_mimetype($file->uri);
+      }
+    }
+
+    fclose($source);
+    fclose($dest);
+
+    $file = file_save($file);
+  }
+  // Unknown error
+  else {
+    drupal_set_message(t("Unknown error occurred attempting to import file: @filepath", array('@filepath' => $file->uri)), 'error');
+    return FALSE;
+  }
+
+  return TRUE;
+}
+
 // Remove once http://drupal.org/node/858274 is resolved.
 if (!function_exists('uuid_set_uuid')) {
   /**
diff --git a/node_export.pages.inc b/node_export.pages.inc
index a71700b..f1aa8db 100755
--- a/node_export.pages.inc
+++ b/node_export.pages.inc
@@ -225,6 +225,58 @@ function node_export_settings() {
     );
   }
 
+  $form['file'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('File fields'),
+  );
+
+  $types = node_type_get_names();
+  $form['file']['node_export_file_types'] = array(
+    '#type' => 'checkboxes',
+    '#title' => t('Files exported for content types'),
+    '#default_value' => variable_get('node_export_file_types', array()),
+    '#options' => $types,
+    '#description' => t('Which content types should export file fields?'),
+  );
+
+  $textarea_delivery = $form['basic']['node_export_code']['#default_value'];
+
+  $mode_message_display = ($textarea_delivery != 'file');
+
+  $form['file']['node_export_file_mode'] = array(
+    '#type' => 'radios',
+    '#title' => t('File export mode'),
+    '#default_value' => variable_get('node_export_file_mode', 'inline'),
+    '#options' => array(
+      'inline' => t('Inline Base64'),
+      'local' => t('Local file export'),
+      'remote' => t('Remote file export, URL')
+     ),
+    '#description' => t('Should file exports be inline inside the export code, a local path to the file, or a URL?  Inline Base64 is the easiest option to use but can sometimes exceed PHP post limits, local and remote modes are more useful for power users.  <em>NOTE: Remote mode only works with a public files directory.</em>'),
+  );
+
+  $form['file']['node_export_file_assets_path'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Export FileField assets path'),
+    '#size' => 60,
+    '#maxlength' => 255,
+    '#default_value' => variable_get('node_export_file_assets_path', ''),
+    '#description' => t(
+      'Optionally, copy files to this path when the node is exported.
+      The primary advantage of this is to divert exported files into a
+      safe location so they can be commmitted to source control (eg: Subversion,
+      CVS, git).  <em>Tip: For install profile developers, setting this
+      path to <code>profiles/my_profile/node_export_assets</code> may be
+      useful.</em>'
+    ),
+    '#required' => FALSE,
+    '#states' => array(
+      'visible' => array(
+        ':input[name=node_export_file_mode]' => array('value' => 'local'),
+      ),
+    ),
+  );
+
   return system_settings_form($form);
 }
 
