Home Backend Development PHP Tutorial thinkphp 下载 基于Http解决思路

thinkphp 下载 基于Http解决思路

Jun 13, 2016 pm 01:32 PM
download public quot

thinkphp 下载 基于Http

PHP code

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

<!--

 

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>

不能下载 求解释

Copy after login


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


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

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


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

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 ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What is the difference between the developer version and the public version of iOS? What is the difference between the developer version and the public version of iOS? Mar 01, 2024 pm 12:55 PM

Every year before Apple releases a new major version of iOS and macOS, users can download the beta version several months in advance and experience it first. Since the software is used by both the public and developers, Apple has launched developer and public versions, which are public beta versions of the developer beta version, for both. What is the difference between the developer version and the public version of iOS? Literally speaking, the developer version is a developer test version, and the public version is a public test version. The developer version and the public version target different audiences. The developer version is used by Apple for testing by developers. You need an Apple developer account to download and upgrade it.

download what does it mean download what does it mean Feb 10, 2024 pm 06:30 PM

English is a weak point for many users. After encountering the word download in life, many users are curious about what it means. Now let’s take a look at the introduction to the meaning of download brought by the editor. What does download mean? Answer: download. 1. The pronunciation of download is /ˌdaʊnˈləʊd,ˈdaʊnləʊd/ in English, and the American /ˌdaʊnˈloʊd,ˈdaʊnloʊd/; 2. Download as a verb means to download, and as a noun, it means downloaded data; 3. Download is a metaphor for computer terminology;

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

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

Java function access permission modifier public usage guide Java function access permission modifier public usage guide Apr 26, 2024 am 08:39 AM

The Java public access modifier allows functions to be accessed from anywhere and is used to declare public APIs and define tools and utilities that are shared across packages or classes. The specific usage is as follows: Syntax: public return value type function name (parameter list) {...} Scenario: functions that need to be accessed from anywhere, methods in public APIs, shared tools or utilities

Java programs display different access levels Java programs display different access levels Aug 19, 2023 pm 10:09 PM

Access modifiers are used to set the feature of visibility of some particular classes, interfaces, variables, methods, constructors, data members, and the setter methods in Java programming language. In Java environment, we have different types of access modifiers. Default - If we declare a function, it will only be visible in a specific package. Private- If we declare a function, it will be available only in a specific class

windows7 english version system download windows7 english version system download Jul 15, 2023 pm 07:45 PM

I believe that netizens are very familiar with the Windows 7 system. Have you heard of the Windows 7 English version system? I believe that many netizens have heard about the Windows 7 English version system. However, some friends are looking for the Windows 7 English version system to download. Today I will The editor is going to share the introduction of the original version of win7 in English with everyone, so that netizens can understand the original version of win7 in English. The following is to tell you where to download the English version of Windows 7 system. The original English system of win7 has been released to MSDN for subscription download. The official English integrated version was first released, Windows7WithSP1, which is the Windows7 CD image with integrated SP1. Includes SP1 standalone for multiple languages

How to use the public modifier in java How to use the public modifier in java Apr 18, 2023 pm 06:04 PM

1. Any other class can access classes, methods, constructors and interfaces declared as public. 2. If the public classes that access each other are distributed in different packages, you need to import the package where the corresponding public class is located. Due to class inheritance, all public methods and variables can be inherited by its subclasses. Example publicclassdemo1{publicstaticvoidmain(String[]args){Personp1=newPerson();p1.fn();System.out.println(p1.a);//100System.out.println(p1.scorce);/

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

不用数据库来实现用户的简单的下载,代码如下,但是却不能下载,请高手找下原因,文件路劲什么的没问题。

See all articles