aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mass_image_import.module7
1 files 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;