I'm trying to upload several files at once from ONE input:
<input type="file" name="form-image[]" id="form-image" multiple="true" />
Which itself without CodeIgniter works fine. In my attempt to do the same thing with CodeIgniters file helper; I get an error (is_uploaded_file() expects parameter 1 to be string, array given), which indicates that I am doing something wrong, or CodeIgniter simply doesn't support multiple files?
My faulty code so far:
//Iterate through each file uploaded
for ($i = 0; isset($_FILES['form-image']['name'][$i]); $i++) {
//Fix the settings
$config['upload_path'] = "./static/vimmel/";
$config['file_name'] = time() . rand(1,988);
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '1024';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload', $config);
//Do the upload
$this->upload->do_upload("form-image")
}
Please note that I did edit out all error handling and such. Also note that I do not use the is_uploaded_file()
function.
Appreciating all help and suggestions. Thanks.