Thinkphp Download based on HttpPHPcodepublicstaticfunctionDownload ($ Download) {import (& quot; Com. Buyback. QueryAmazon & quot;); import (& quot; ORG. Net. Htt thinkphp Download based on Http
PHP code
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'];} click DownloadDownloadCannot download for explanation
------ Solution --------------------
Download
Oa/Tpl/Public/Upload/{$ vo. Download} is this address correct. Whether the front side should be something or not. change it to an absolute link.
Make sure the link is correct. The problem is found.