Home >Backend Development >PHP Tutorial > thinkphp 上载 基于Http

thinkphp 上载 基于Http

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 12:59:25809browse

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}这个地址对吗。是不是前边应该有点什么,改成绝对链接试试。

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


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn