anyone can help me.. its work only if at least 2 files uploaded and then the first file didn't move to upload folder.. anyone can help.. here's my code
// view
<?php echo form_open_multipart($this->uri->uri_string()); ?>
<p>
<?php echo form_label('Image') ?>
<input type="file" name="userfile[]" size="20" class="multi" accept="gif|jpg|png"/>
</p>
// controller
function album($id){
if (isset($_POST['submit']))
{
$config['upload_path'] = './assets/gallery/'; // server directory
$config['allowed_types'] = 'gif|jpg|png'; // by extension, will check for whether it is an image
$config['max_size'] = '1000'; // in kb
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload', $config);
$this->load->library('Multi_upload');
$files = $this->multi_upload->go_upload();
if ( ! $files )
{
$data['error'] = $this->upload->display_errors();
}
else
{
$data = array('upload_data' => $files);
}
}
$id = $this->uri->segment(3);
$data['query'] = $this->administrator_model->getAllPhoto($id);
$data['current'] = 'home';
$data['side'] = 'gallery';
$data['attr'] = 'view_album';
$data['content'] = 'backend/administrator_manage';
$data['sidebar'] = 'backend/home_sidebar';
$this->load->view("backend/index", $data);
}
// multi upload library i use from here
with little modification