English 中文(简体)
密码用户的上载图像问题
原标题:upload image problem at codeigniter

Hello frind 我想在两个不同地点上上载两幅图像,但在同一地点仍收到传票。 请帮助

//upload images
        //some $config vars for image
        $config[ upload_path ] =  ./images/articles ;
        $config[ allowed_types ] =  gif|jpg|jpeg|png|mp3|wav ;
        $config[ max_size ] =  0 ;
        $config[ remove_spaces ] = true;
        $config[ overwrite ] = false;
        $config[ max_width ] =  0 ;
        $config[ max_height ] =  0 ;

        $this->load->library( upload , $config);

        //upload main image
        if(!$this->upload->do_upload( a_image )){
            $e = $this->upload->display_errors();
            //print_r($e);
        }

        $image = $this->upload->data();
        if($image[ file_name ]){
            $data[ a_image ] = "images/articles/". $image[ file_name ];
        }

        unset($config);

        //now upload thumb
        //some $config vars for thumb
        $config[ upload_path ] =  ./images/articles/thumb ;
        $config[ allowed_types ] =  gif|jpg|jpeg|png|mp3|wav ;
        $config[ max_size ] =  0 ;
        $config[ remove_spaces ] = true;
        $config[ overwrite ] = false;
        $config[ max_width ] =  0 ;
        $config[ max_height ] =  0 ;    
        $this->load->library( upload , $config);


        //upload thumbnail
            if(!$this->upload->do_upload( a_thumbnail )){
            $this->upload->dispaly_errors();    
        }   
最佳回答

第二次打电话

$this->upload->initialize($config)

而不是

$this->load->library( upload , $config);

另外,您可以重新使用<代码>config阵列,仅改变需要改变的数值......

问题回答

暂无回答




相关问题
PHP Framework: Ebay Like Site

I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal. What would be the best PHP framework to use to build this quickly, ...

What s the proper MVC way to do this....?

Quick question about general MVC design principle in PHP, using CodeIgniter or Kohana (I m actually using Kohana). I m new to MVC and don t want to get this wrong... so I m wondering if i have ...

Check session from a view in CodeIgniter

What is the best way to check session from a view in CodeIgniter, it shows no way in their user guide, otherwise I will have to make two views on everything, which is kinda weird...still a newbie to ...

Using SimplePie with CodeIgniter and XAMPP

I am using CodeIgniter 1.7.2 with XAMPP 1.7.2 on a Windows computer. I am trying to make use of SimplePie. I followed all the instructions I could find: a copy of simplepie.inc is in my applications/...

CodeIgniter adding semicolons

How do I stop CodeIgniter adding semicolons ; to data sent via POST that contains ampersand &? For example it is converting "a=1&b=2&c=3" into "a=1&b;=2&c;=3". From looking on the forums ...

Best way to make Admin pages in CodeIgniter?

I m working on an app in CodeIgniter, and I want to have admin pages for several of the objects in the application, and I m wondering what would be the better way to put these into an MVC structure. ...

CodeIgniter form verification and class

I m using the form validation library and have something like this in the view <p> <label for="NAME">Name <span class="required">*</span></label> <?...

热门标签