Welcome Guest, Not a member yet? Register   Sign In
File uploading class bug or my bad ?
#1

[eluser]CappY[/eluser]
The controller:

Code:
$config['upload_path'] = '/var/www/npsig/htdocs/backgrounds/';
        $config['allowed_types'] = 'jpg|jpeg|png';
        $config['overwrite'] = FALSE;
        $config['max_size'] = '256';
        $config['max_width'] = '250';
        $config['max_height'] = '250';
        //$config['file_name'] = 'image'.$data['backgrounds']->row()->id.'.png';
        $this->load->library('upload', $config);
        
        if (!$this->upload->do_upload())
        {
            $data['msg'] = $this->upload->display_errors();
        }
        else
        {
            $data['msg'] = $this->upload->data();
        }
That's view:
Code:
<?=$msg?>

<?php echo form_open_multipart('submit/background');?>

<input type="file" name="userfile" size="50" />

<br /><br />

&lt;input type="submit" name="submit" value="Submit background" /&gt;

&lt;/form&gt;

I always get:
Code:
The upload path does not appear to be valid.

I tried changing to:
Code:
$config['upload_path'] = './backgrounds/';
$config['upload_path'] = '/backgrounds/';
$config['upload_path'] = 'backgrounds/';
$config['upload_path'] = './backgrounds';
$config['upload_path'] = '/backgrounds';
$config['upload_path'] = 'backgrounds';

CI architecture is that way:

root
root/application <- controllers,models,views.
root/system
root/htdocs
root/htdocs/backgrounds <- upload dir


Messages In This Thread
File uploading class bug or my bad ? - by El Forum - 02-26-2011, 08:00 AM
File uploading class bug or my bad ? - by El Forum - 02-26-2011, 08:39 AM
File uploading class bug or my bad ? - by El Forum - 02-26-2011, 08:45 AM
File uploading class bug or my bad ? - by El Forum - 02-26-2011, 08:54 AM
File uploading class bug or my bad ? - by El Forum - 02-26-2011, 09:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB