thinkphp 上载 基于Http

WBOY
Release: 2016-06-13 12:59:25
Original
759 people have browsed it

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 />
Copy after login

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


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

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


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template