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

[版本 3.x] 同一段代码,上传图片正常,但上传mp3文件服务器上没有.....

[复制链接]
发表于 2016-3-3 12:24:27 | 显示全部楼层 |阅读模式
           $config['upload_path'] = './uploads/'.date('Y').'/'.date('m').'/'.date('d').'/'.'mp3/';
            if(!file_exists($config['upload_path'])){
                                mkdir($config['upload_path'],0777,true);
                        }
            //$config['file_name']='audio'.date('His').rand(100,999);
            $config['allowed_types'] = 'mp3|jpg';
                        $config['encrypt_name'] = 'TRUE';
                        $this->upload->initialize($config,true);
            $this->upload->do_upload('fileaudio');
            $fileurl = $this->upload->data('file_name');
            $this->load->library('audioInfo');
            $this->upload->display_errors('<p>', '</p>');
            print_r($this->upload->data());

上传jpg成功,但上传mp3文件,没有报错,但服务器上没有上传的文件

 楼主| 发表于 2016-3-3 13:14:23 | 显示全部楼层
上传mp3提示:The filetype you are attempting to upload is not allowed.
发表于 2016-3-3 13:34:48 | 显示全部楼层
試著在 config / mimes.php 內修改 mp3 的值
'mp3' => array('audio/mpeg','audio/mpeg3','audio/mpg','audio/x-mpeg','audio/mp3','application/force-download','application/octet-stream'),

本版积分规则