首页 >后端开发 >php教程 >thinkphp 上载 基于Http

thinkphp 上载 基于Http

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原创
2016-06-13 11:04:24918浏览

thinkphp 下载 基于Http

<br />public static function Download($Download){<br />    import("Com.Buyback.QueryAmazon"); <br />    import("ORG.Net.Http"); <br />    $bookInformModel =M("admin"); <br />    $result = $bookInformModel->where("Download='$Download'")->select();<br />    if($result[0]['image'] == ""){<br />    $data['id'] = $result[0]['id'];<br />    $remoteUrl = QueryAmazon::getImage($Download); <br />    if(!empty($remoteUrl['ImageURL'])){<br />    $localUrl = "oa/Tpl/Public/Upload/".$Download.".jpg";<br />    Http::curl_download($remoteUrl['ImageURL'], "./".$localUrl);<br />    }else{<br />    $localUrl = "oa/Tpl/Public/Upload/";<br />    }<br />    $data['image'] = $localUrl;<br />    $bookInformModel->save($data);<br />    return $localUrl;<br />} <br />return $result[0]['image'];<br />} <br /><br />点击下载的时候<br /><td align="center" colspan="2"><a href="oa/Tpl/Public/Upload/{$vo.Download}">下载</a></td><br />不能下载 求解释<br />

------解决方案--------------------
下载


oa/Tpl/Public/Upload/{$vo.Download}这个地址对吗。是不是前边应该有点什么,改成绝对链接试试。

确保链接没问题。就找到问题了


声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn