I'm scraping a some sites into a csv which is then used by feeds importer module to create Drupal content.
Some of the content are html chunks containing html+images in them which go into "body"/textarea kind of fields to be displayed.
How do I use feeds tamper or some other method to
- Download these embedded images to server and
- Rewrite the image paths in the HTML chunks to point to server paths
Possible solution:
- Rewrite the paths in the html to internal paths registered via "hook_menu". When the path is called, if the image is not there, use "system_retrieve_file" to download the file and serve it .. Example hook_menu() implemented at image_menu. {Thanks Ciss @ drupal-support irc channel} Rewriting would be taken care of by feed_tamper that I have already.
To clarify - I know that if I use image urls with image fields, the images will be downloaded automatically. However I don't know how to download images that are within a HTML chunk.. thanks.