图像下载0字节

时间:2015-07-08 02:29:21

标签: php download

我正在尝试在php中下载图像,下载已完成,但图像以0字节传到我这里。

<?php
$array = array("12345" => "guarana.jpg");

    $titulo = "Aula 17 - Download de arquivo";

    $idArquivo = $_GET['id'];
header("Content-type: image/jpeg");
    header("Content-Disposition: attachment; filename=refri.jpg");

//the image is in the folder arquivos/guarana.jpg
        readfile("../arquivos/".$array[$idArquivo]);

我正在尝试使用网址http://localhost/DevMedia/PHP/app/download/index.php?id=12345

下载img

0 个答案:

没有答案