diff options
author | Silvio <silvio@devlet.com.br> | 2010-10-14 12:21:03 -0300 |
---|---|---|
committer | Silvio <silvio@devlet.com.br> | 2010-10-14 12:21:03 -0300 |
commit | fcbf2c14e8f3c85f9bfd4ba6ecf333e091880c37 (patch) | |
tree | 7093993ef2249a3dd6a192f7bcc9f5c6f1be27b5 | |
parent | bc0e7da522b389aaccb9239e0a82498e8edbe58b (diff) | |
download | mass_image_import-fcbf2c14e8f3c85f9bfd4ba6ecf333e091880c37.tar.gz mass_image_import-fcbf2c14e8f3c85f9bfd4ba6ecf333e091880c37.tar.bz2 |
Fixing upload image path
-rw-r--r-- | mass_image_import.module | 7 |
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; |