Index: flashvideo.module
===================================================================
--- flashvideo.module	(revision 1.73.2.118)
+++ flashvideo.module	(working copy)
@@ -1386,11 +1386,27 @@ function flashvideo_import($path, $node_
       // Create a temporary file object.
       $tempfile->filepath = $file->filename;
 
+      if (!module_exists('filefield') || flashvideo_variable_get(NULL, 'flashvideo_filefield', 0) == FALSE) { 
       // Replace the covert directory with blank string so that it will move out of the convert directory.
       $tempfile->filepath = str_replace($path .'/', '', $tempfile->filepath);
+      }
+      else {
+        // Using FileField to set the path of the original directory
+        $field_name = flashvideo_variable_get($node_type, 'cck_original_video_field', '');
+        $field = content_fields($field_name, $node_type); // Get array of info about the field.
+        $filefield_path = $field['widget']['file_path']; // Get the specific file path that was set for the field.
+        // If they have Token module installed, search the $filefield_path for tokens and get them replaced.
+        if (module_exists('token')) {
+          // Since we give ownership of the file to user-1, we need to use that account for token generation
+          $filefield_path = token_replace($filefield_path, 'user', user_load(1));
+        }
+        $original_directory = file_directory_path() .'/'. $filefield_path;
+        file_check_directory($original_directory, TRUE);
+        $tempfile->filepath = file_directory_path() .'/'. $filefield_path .'/'. basename($tempfile->filepath);
+      }
 
       // Munge up the filename for security reasons.
-      $tempfile->filepath = file_munge_filename($tempfile->filepath, '');
+      $tempfile->filepath = dirname($tempfile->filepath).'/'.file_munge_filename(basename($tempfile->filepath), '');
 
       // Delete potential exploit files for security reasons.
       if (preg_match('/\.(php|pl|py|cgi|asp|js)$/i', $tempfile->filepath)) {
