-2

I have say 5 URLs of five images available from Google search. Now I wish to download them on client side. Any way to do it using PHP ?

Prashant Singh
  • 3,725
  • 12
  • 62
  • 106

1 Answers1

0

No. PHP doesn't download to clients. The client (i.e. a browser) can download from a server, and the server may use PHP to send the data.

[edit]

  1. To send a single image, you must set the right header, to specifiy the content type of the image. See http://www.ehow.com/how_7280601_send-php-image-file.html

  2. To send multiple images, you could send a multipart response. Unfortunately support for this type of response is poor. Don't use it.

  3. Or you can just send a html page with <img> tags in it. The url of the image can be a direct file location, or a PHP script that sends a single image, like in 1.

GolezTrol
  • 114,394
  • 18
  • 182
  • 210
  • Sorry, I am not getting. What should I do to download images when the user visits the page ? – Prashant Singh Oct 02 '12 at 11:02
  • Can you update your answers with a small example ? I am using CURL to get the image URLs. Now I need to download those images when client visits them. What options do I have ? – Prashant Singh Oct 02 '12 at 11:05
  • Just include them in the page? Your question doesn't make sense. Provide more context by editing the question. – GolezTrol Oct 02 '12 at 11:06