[eluser]Krystian[/eluser]
Hi, I created upload folder in root. The file doesnt go. Why? This is almost pasted from documentation....
Code:
function do_upload()
{
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '500';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());
$this->load->view('cms/worksError_view', $error);
}
else
{
$data = array('upload_data' => $this->upload->data());
// insert do bazy i gitara
$this->load->view('cms/cms_view');
}
}
my form looks like this
Code:
<?php
$data = array(
'name' => 'fileUpload',
);
echo form_open_multipart('main/do_upload');
echo form_textarea('username');
echo form_upload($data);
echo form_submit('mysubmit', 'Add');
echo form_close();
?>
when I printed the error array I got
You did not select a file to upload.
???
cheers