微信回复图片消息时长5s以内,如何快速的下载图片,这个picurl没有后缀的
http://www.cnblogs.com/dmm888/p/4390627.html
http://www.php100.com/html/php/lei/2013/0905/5367.html
<?php
function get_file($url,$folder,$pic_name){
set_time_limit(24*60*60); //限制最大的执行时间
$destination_folder=$folder?$folder.'/':''; //文件下载保存目录
$newfname=$destination_folder.$pic_name;//文件PATH
$file=fopen($url,'rb');
if($file){
$newf=fopen($newfname,'wb');
if($newf){
while(!feof($file)){
fwrite($newf,fread($file,1024*8),1024*8);
}
}
if($file){
fclose($file);
}
if($newf){
fclose($newf);
}
}
}
get_file("http://www.baidu.com/img/baidu_logo.gif","file","baidu.jpg");
?>
如果要快速的话,只能设法提高网络连接速度,可以使用反向代理或者部署cdn。没有一种方法可以让客户端加速下载。