search
HomeBackend DevelopmentPHP Tutorial thinkphp 下载 基于Http解决思路

thinkphp 下载 基于Http

PHP code
<!--

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>
不能下载 求解释



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


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
iOS的developer版和public版有什么区别?iOS的developer版和public版有什么区别?Mar 01, 2024 pm 12:55 PM

每年Apple发布新的iOS和macOS大版本之前,用户都可以提前几个月下载测试版抢先体验一番。由于公众和开发人员都使用该软件,所以苹果公司为两者推出了developer和public版即开发者测试版的公共测试版。iOS的developer版和public版有什么区别呢?从字面上的意思来说,developer版是开发者测试版,public版是公共测试版。developer版和public版面向的对象不同。developer版是苹果公司给开发者测试使用的,需要苹果开发者帐号才可以收到下载并升级,是

download是什么意思download是什么意思Feb 10, 2024 pm 06:30 PM

英语是很多用户薄弱的地方,有很多的用户在生活中遇到download这个词之后,好奇是什么意思呢?现在就来看一下小编给大家带来的download含义介绍吧。download是什么意思答案:下载。1、download读音英/ˌdaʊnˈləʊd,ˈdaʊnləʊd/,美/ˌdaʊnˈloʊd,ˈdaʊnloʊd/;2、download作为动词的意思下载,作为名词的意思是已下载的数据资料;3、download比喻用法,用于计算机术语;

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决Jun 13, 2016 am 10:23 AM

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code<form name="myform"

Java程序展示不同的访问级别Java程序展示不同的访问级别Aug 19, 2023 pm 10:09 PM

Accessmodifiersareusedtosetthefeatureofvisibilityofsomeparticularclasses,interfaces,variables,methods,constructors,datamembers,andthesettermethodsinJavaprogramminglanguage.在Java环境中,我们有不同类型的访问修饰符。默认-如果我们声明一个函数,它只会在特定的包中可见。Private-如果我们声明一个函数,它只能在特定的类中可

java中的public修饰符怎么用java中的public修饰符怎么用Apr 18, 2023 pm 06:04 PM

1、任何其他类都可以访问被声明为public的类、方法、构造方法和接口。2、若相互访问的public类分布在不同的包中,则需要导入相应public类所在的包。由于类的继承,所有的公共方法和变量都可以由其子类继承。实例publicclassdemo1{publicstaticvoidmain(String[]args){Personp1=newPerson();p1.fn();System.out.println(p1.a);//100System.out.println(p1.scorce);/

windows7英文版系统下载windows7英文版系统下载Jul 15, 2023 pm 07:45 PM

相信网友们都对windows7系统非常熟悉,那大家听说过windows7英文版系统吗?相信有非常多的网友都对windows7英文版系统略有耳闻,不过有的朋友找windows7英文版系统下载,今天小编就要把win7英文原版系统介绍分享给大家,让网友们都能了解到英文win7原版系统。下面就是告诉你windows7英文版系统哪里下载。win7英文原版系统已发布到MSDN订阅下载,官方首先发布的英文集成版,Windows7WithSP1,即集成SP1的Windows7光盘镜像。包含适用于多语言的SP1独

Java 函数的访问权限修饰符之 public 使用指南Java 函数的访问权限修饰符之 public 使用指南Apr 26, 2024 am 08:39 AM

Javapublic访问权限修饰符允许函数从任何位置访问,用于声明公共API、定义跨包或类共享的工具和实用程序。具体用法如下:语法:public返回值类型函数名称(参数列表){...}场景:需要从任何地方访问的函数、公共API中的方法、共享的工具或实用程序

不用数据库来实现用户的简单的下载,代码如下,但是却不能下载,请高手找下原因,文件路劲什么的没有关问题不用数据库来实现用户的简单的下载,代码如下,但是却不能下载,请高手找下原因,文件路劲什么的没有关问题Jun 13, 2016 am 10:15 AM

不用数据库来实现用户的简单的下载,代码如下,但是却不能下载,请高手找下原因,文件路劲什么的没问题。<?phpfunction down_file($file_name,$file_sub_dir){//为防止乱码使用函数iconv$file_name=iconv("utf-8","gb2312",$file_

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software