Downloading an image to client side using PHP [closed]

你。 提交于 2019-12-13 22:26:12

问题


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 ?


回答1:


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.



来源:https://stackoverflow.com/questions/12689012/downloading-an-image-to-client-side-using-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!