Index: filefield.migrate.inc =================================================================== --- filefield.migrate.inc (revision 123) +++ filefield.migrate.inc (working copy) @@ -15,7 +15,7 @@ foreach (filefield_migrate_fields_node($node->type) as $source_key => $label) { if (isset($node->$source_key)) { - $source_file = $node->$source_key; + $source_files = $node->$source_key; $field_name = preg_replace('/_sourcefile$/', '', $source_key); $field = content_fields($field_name, $tblinfo->desttype); @@ -25,15 +25,20 @@ } $files_path = _migrate_widget_files_directory($field); - if ($file = field_file_save_file($source_file, $validators, $files_path)) { - if (!isset($node->$field_name)) { - $node->$field_name = array(); + if (!is_array($source_files)) { + $source_files = array($source_files); + } + foreach ($source_files as $source_file) { + if ($file = field_file_save_file($source_file, $validators, $files_path)) { + if (!isset($node->$field_name)) { + $node->$field_name = array(); + } + array_push($node->$field_name, $file); } - array_push($node->$field_name, $file); + else { + $errors[] = migrate_message(t('File save failed for %file', array('%file' => $source_file))); + } } - else { - $errors[] = migrate_message(t('File save failed for %file', array('%file' => $source_file))); - } } } return $errors;