关于下载问题

#1 swhmail@126.com

       下载1
点击 链接时就进入了首页,如何进行处理,使用能够进行下载?

      下载2也不行,后台代码为

    function downloadfile()
    {
$filename = $this->spArgs('filename');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' .  $filename );
    }

2012-04-07 11:19:06

#2 jake

第一种连接,“点击 链接时就进入了首页”,看看验证地址是否正确或者是否存在那个文件,可以试试用绝对地址,这样更容易找文件。

第二种连接,你说“也不行”,但是没说明情况,所以不好判断。上面的代码看起来没什么问题。

2012-04-07 11:25:37

#3 swhmail@126.com

谢谢,是文件地址的问题

2012-04-07 14:08:47