This question already has an answer here:

I use rules and the media module and would like to add remote images like http://upload.wikimedia.org/wikipedia/de/6/61/Weingarten_Zentrum1.jpg programmatically with php.

I found this post but I still have no idea what exactly to do.. How to programmatically add image from external URL using media module?

marked as duplicate by kiamlaluno Jun 12 '13 at 9:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • I can't get the idea about your question....Can You Please Elaborate.. What i Understood is that you want to fetch a image form other website to your drupal website by changing "src" attribute of img tag – Swastik Pareek Jun 12 '13 at 8:39
  • if Media module is not your project neccessity you van use ckeditor for this. – Swastik Pareek Jun 12 '13 at 8:52
  • Hello and welcome to Drupal Answers. May you edit your question to explain what exactly you didn't understand in the answers given for the other question? Without that information, this question is a duplicate of the other question. – kiamlaluno Jun 12 '13 at 9:43
  • ok, I got it: If you have an url of an image and you would like to insert into with php for the media module, it works like this: code $image = file_get_contents($urlToImage); $file = file_save_data($image,'public://'.$imageName,FILE_EXISTS_REPLACE); $node-> field_dorfbild['und'][0] = array('fid'=>$file->fid, 'display'=>1);code – Jo Pfeffer Jun 12 '13 at 22:06

Browse other questions tagged or ask your own question.