Im trying to upload multiple files from a single form but for some reason i get "The upload path does not appear to be valid." I have checked permissions and they are correct, so i dont know if this is a problem with the images it self.. these are the functions i use to create the images
<input type="file" name="images[]" multiple id="img"></input>
function upload_image(){
$config['allowed_types'] = 'gif|jpg|png|jpeg';
$config['max_size'] = 2*1024;
$config['max_width'] = '1024';
$config['max_height'] = '1024';
$config['remove_spaces'] = TRUE;
$this->load->library('upload', $config);
if (!$this->upload->do_upload('images'))
{
$error = array('error' => $this->upload->display_errors());
return $error;
}
else
{
for($i = 0, $t = count($_FILES['images']); $i < $t; $i++) {
$id = $this->files->create_thumb($i);
}
}
}
function create_thumb($i){
$file = $this->upload->data();
$files = $file['file_name'];
$fields = array('files' => $files[$i]);
print_r($fields);
exit;
for ($i = 0; $i < count($files); $i++) {
$config['image_library'] = 'gd2';
$config['source_image'] = 'files/images/'.$files[$i];
$config['new_image'] = 'files/images/thumbs/'.$files[$i];
$config['thumb_marker'] = '';
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 120;
$config['height'] = 120;
$this->load->library('image_lib');
$this->image_lib->initialize($config);
$this->image_lib->resize();
$this->image_lib->clear();
}
}