I've been trying to do a multi file upload with codeigniter 1.7. I'm having issues to say the least!
I know its an old version but thats what ive got to work with.
Can I loop the $_FILES array and upload each one? It doesnt seem to work.
Heres what ive got?
Code:
$dir_name = $this->input->post('dir');
$file_path = "./system/application/views/courses/course/";
$full_file_path = $file_path . $dir_name;
if (!file_exists($full_file_path)) {
mkdir($full_file_path, 0777, true);
}
$config['upload_path'] = $full_file_path;
$config['allowed_types'] = 'php|js|html';
$this->load->library('upload');
foreach ($_FILES as $files => $fileObject) //
{
if (!empty($fileObject['name']))
{
$this->upload->initialize($config);
if (!$this->upload->do_upload($files))
{
$errors = $this->upload->display_errors();
}
else
{
echo "It worked";
}
}
}
Is this posssible?
This code runs but doesnt upload the files?!