-1

i am currently working on a project where i need to get a exsternal pages content with php, i am using

file_get_html()

to pass the html, now, is it possible to get images? and then upload them with

move_uploaded_file()

If someone could point me in the right direction, that would be great

John Smith
  • 115
  • 3
  • 6
  • To clearify, i do not want to link to the image, i want to get the image and upload it – John Smith Mar 16 '13 at 20:45
  • possible duplicate of [Copy Image from Remote Server Over HTTP](http://stackoverflow.com/questions/909374/copy-image-from-remote-server-over-http) – mario Mar 16 '13 at 20:45
  • looks like you are using `simplehtmldom` library. Create array of images from img tags, then use curl to retrieve them. Not hard to search SO and web on how to do it – charlietfl Mar 16 '13 at 23:43

1 Answers1

0

I would look at using curl if you want to return images to your server. I've done this a few times and it is much easier (in my opinion) to grab the images you want. Something like the following might work for you if you already have the path to the external image: http://www.edmondscommerce.co.uk/php/php-save-images-using-curl/

This can also open up a lot more flexibility on grabbing external pages quickly.

Cameeob2003
  • 482
  • 1
  • 6
  • 16