OK i solved it in a different way. since I actually want to move the files from temp to a different folder I added this to the file moving:
// Move files
foreach ($this->data['data']['form_data']['userfile'] as $key => $value)
{
$new_value = preg_replace("/[^a-zA-Z0-9.]/", "_", $value);
rename('./uploads_tmp/' . $session_id . '/' . $value, './uploads/' . $new_value);
}
// Remove temp folder
rmdir('./uploads_tmp/' . $session_id . '/');
This works.