Welcome Guest, Not a member yet? Register   Sign In
Upload error
#1

[eluser]Thiago Leao[/eluser]
hi friends, I need help with upload multiples...

ERROR

The upload path does not appear to be valid.

cad_produto.php (controller)
Code:
function upload(){
        $data['titulo'] = 'Catalogo Colletion - AdministraĆ§Ć£o!';
        $this->load->view('administracao/upload_produto', $data);
    }
    
    function do_upload()
    {
        
        $config['upload_path'] =  base_url().'assets/uploads/';
        echo print_r($config);
        $config['allowed_types'] = 'gif|jpg|png';
        $config['max_size']    = '2000'; // in kb
        $config['max_width']  = '1024';
        $config['max_height']  = '768';
        
        $this->load->library('upload', $config);
        $this->load->library('Multi_upload');
        
        $this->upload->initialize($config);
        
        $files = $this->multi_upload->go_upload();
        
        if ( ! $files )        
        {
            $error = array('error' => $this->upload->display_errors());
            $this->load->view('administracao/upload_produto', $error);
        }    
        else
        {
            $data = array('upload_data' => $files);
            $this->load->view('administracao/upload_success', $data);
        }
    }

upload_produto (view)

Code:
<?php if (isset($error)) echo $error;?>
<?php echo form_open_multipart(base_url().'administracao/cad_produto/do_upload');;?>
<input type="file" name="userfile[]" size="20" class="multi" />
<br /><br />

&lt;input type="submit" value="upload" /&gt;

&lt;/form&gt;
#2

[eluser]Thiago Leao[/eluser]
Anyone?
thanks
#3

[eluser]Rolly1971[/eluser]
i just the other day incorporated the uploadify jquery plugin and had some fun getting the pathing to work correctly. but got it working by setting the config item: upload_path like this:

Code:
$config['upload_path'] = realpath('assets/uploads/');

just make sure the folder exists where you specify it to be and you should be good.
#4

[eluser]Thiago Leao[/eluser]
hi friend, it worked perfectly!
Can you explain why it worked with realpath and not as it was before?

thanks
#5

[eluser]Dule[/eluser]
Thanks from my side also... It just works, and I don't care why...




Theme © iAndrew 2016 - Forum software by © MyBB