ahkxhyl 发表于 2013-4-25 10:36:07

uploadify使用CI自带的upload类上传报错

我的CI是2.0的,CI控制器部分代码
function up() {//print_r($_FILES['userfile']['tmp_name']);exit;在这里可以取到上传内容
$uid = get_cookie('user_id');
      if ($uid) {
$this->load->model('Usermodel');
            $path = $_SERVER["DOCUMENT_ROOT"] . "/upfiles/photo/" . $uid;
            if (!file_exists($path)) {
                mkdir($path, 0777);
            }
               
            $config['upload_path'] = $path;
            $config['allowed_types'] = 'gif|jpg|png|jpeg';
            $config['max_size'] = '1000000';
            $config['max_width'] = '6000';
            $config['max_height'] = '6000';
            $config['encrypt_name'] = 'true';
            $this->load->library('upload', $config);
            if (!$this->upload->do_upload()) {
                echo$error =$this->upload->display_errors();//然后走到这里报错You did not select a file to upload.

            } else {
                $this->load->library('image_lib');

Hex 发表于 2013-4-25 10:39:50

do_upload 方法需要一个参数,来指明你的 input 的 name 是什么,一看就是没看手册,呵呵

蜗牛999 发表于 2013-8-20 17:34:25

我的更改了php.ini配置好了。
页: [1]
查看完整版本: uploadify使用CI自带的upload类上传报错