I'm using Drupal 7.56.. I want to upload images from other urls.. I use:
$image_original_path = '.. here my original path..'; $my_destination = 'sites/default/files/images/'; $my_new_name = 'my_image.jpg'; $filename = $my_destination.$my_new_name; $image_object = file_get_contents($image_original_path); $file = file_save_data($image_object, $base_url.'/'.$filename, FILE_EXISTS_RENAME);
But the image is not uploaded.. Any idea please? Thank you..