Controller code
$config['upload_path'] = './uploads/'.$random;
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = 100;
$config['max_width'] = 1024;
$config['max_height'] = 768;
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload('imageupload'))
{
$error = array('error' => $this->upload->display_errors());
}
else
{
$data = array('upload_data' => $this->upload->data());
}
print_r($data);
HTML code:
<form role="form" enctype="multipart/form-data" accept-charset="utf-8" name="formname" id="formname" method="post" action="http://www.example.com/Property/post">
<input type="file" class="default" id="imageupload1" name="imageupload[]">
</form>
Whenever I am uploading file it displaying warning is_uploaded_file() expects parameter 1 to be string, array given. How can I resolve it?