Welcome Guest, Not a member yet? Register   Sign In
Problem uploading file.. i dont know why
#1

[eluser]Asinox[/eluser]
Hi guys, i think that all is fine.. i have anothers functions uploadings files too, and working, but this function have problem with the "path", i dont know why if all is fine...my directory have 777 permission

i was trying with different way for the path and nothing... the path is no valid ...


sorry with my english

Code:
function doAddPelicula(){
        if($this->form_validation->run('add_pelicula')==FALSE){
            $this->addPelicula();
        }else{
            //$config['upload_path'] = 'http://www.domain.com/public/uploads/cines/';      
                        //    $config['upload_path'] = './public/uploads/cines/';
            $config['upload_path'] =  './public/uploads/cines/';
            $config['allowed_types'] = 'gif|jpg|png';
            $config['max_size']    = '500';
            $config['max_width']  = '1024';
            $config['max_height']  = '768';
            $config['encrypt_name'] = TRUE;
            $config['remove_spaces'] = TRUE;

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

            if ( ! $this->upload->do_upload()){
                $data['titulo']    = 'Agregar Pelicula';
                $data['error'] = array('error' => $this->upload->display_errors());                                
                $data['main'] ='dashboard/cine/admin_pelicula_add';
                $this->load->vars($data);
                $this->load->view('dashboard/maqueta');

            }else{
                $data =  $this->upload->data();
            
                $nombre = $data['raw_name'].'_thumb'.$data['file_ext'];
                $config['image_library'] = 'gd2';
                $config['source_image']    = $data['full_path'];
                $config['create_thumb'] = TRUE;
                $config['new_image'] = $data['file_path'].$nombre;
                $config['maintain_ratio'] = TRUE;
                $config['width']     = 150;
                $config['master_dim'] = 'width';
                $config['height']    = 100;                
                $this->load->library('image_lib', $config);                
                $this->image_lib->resize();
                
                if($this->pelicula->save($nombre)){
                    redirect('dashboard/indexPeliculas/');
                }
            }                        
        }
    }
#2

[eluser]Asinox[/eluser]
ok,.. sorry i was loading the library twice...




Theme © iAndrew 2016 - Forum software by © MyBB