From fcbf2c14e8f3c85f9bfd4ba6ecf333e091880c37 Mon Sep 17 00:00:00 2001 From: Silvio Date: Thu, 14 Oct 2010 12:21:03 -0300 Subject: Fixing upload image path --- mass_image_import.module | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mass_image_import.module b/mass_image_import.module index 5bcf731..137cac3 100644 --- a/mass_image_import.module +++ b/mass_image_import.module @@ -282,9 +282,10 @@ function mass_image_import_create_node_from($filepath, $title, $body, $type) { $info = content_types($type); $field = mass_image_import_field($info['fields']); - // Make sure we can copy the file into our temp directory. + // Copy file. $original_path = $filepath; - if (!file_copy($filepath, _image_filename($filepath, IMAGE_ORIGINAL, TRUE))) { + $destpath = file_create_path(file_directory_path() . '/' . variable_get('image_default_path', 'images')); + if (!file_copy($filepath, $destpath)) { return FALSE; } @@ -298,7 +299,7 @@ function mass_image_import_create_node_from($filepath, $title, $body, $type) { $file->timestamp = time(); drupal_write_record('files', $file); - // Create the node. + // Create node. $node = new StdClass(); $node->type = $type; -- cgit v1.2.3