Maison >développement back-end >tutoriel php >thinkphp 下载 基于Http解决思路
thinkphp 下载 基于Http
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->public static function Download($Download){ import("Com.Buyback.QueryAmazon"); import("ORG.Net.Http"); $bookInformModel =M("admin"); $result = $bookInformModel->where("Download='$Download'")->select(); if($result[0]['image'] == ""){ $data['id'] = $result[0]['id']; $remoteUrl = QueryAmazon::getImage($Download); if(!empty($remoteUrl['ImageURL'])){ $localUrl = "oa/Tpl/Public/Upload/".$Download.".jpg"; Http::curl_download($remoteUrl['ImageURL'], "./".$localUrl); }else{ $localUrl = "oa/Tpl/Public/Upload/"; } $data['image'] = $localUrl; $bookInformModel->save($data); return $localUrl;} return $result[0]['image'];} 点击下载的时候<td align="center" colspan="2"><a href="oa/Tpl/Public/Upload/%7B%24vo.Download%7D">下载</a></td>不能下载 求解释