用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1932|回复: 2
收起左侧

[HELP] 求救!开发电脑验证通过,传到服务器后下载功能失效

[复制链接]
发表于 2011-7-5 16:48:43 | 显示全部楼层 |阅读模式
本帖最后由 果冻 于 2011-7-5 16:50 编辑

$file_name = $result_url;
                        $file_dir = "http://www.cyber-dreams.net/vector/";
                        $filehttp = $file_dir.$file_name;
                        $fileftp = "ftp://xxxx:1111@xx.xx.xx.xx:21/www/vector/mingqtu.jpg";
                        $file = @ fopen($fileftp,"r");
                        //echo $file;
                        //die(0);
                        if (!$file) {
                        echo "文件找不到";
                        } else {
                        header("content-type: application/octet-stream");
                        header("content-disposition: attachment; filename=" . $file_name);
                        while (!feof ($file)) {
                        echo fread($file,50000);
                        }
                        fclose ($file);
                        }
这段代码,用来实现图片下载。在开发电脑上测试通过,为什么传到ftp服务器上后,提示文件找不到呢?不管用如上http方式还是用ftp方式都不能下载,提示,找不到文件。

发表于 2011-7-5 16:50:49 | 显示全部楼层
是不是服务器没有开启对应的功能哦
 楼主| 发表于 2011-7-5 17:20:27 | 显示全部楼层
服务器还有对应的功能?不清楚,我是新手。怎么开启啊?服务器不也是php环境吗?

本版积分规则