[eluser]Armchair Samurai[/eluser]
I'm having an odd issue with the upload library - it's adding extra underscores to the filename if it has more than one dot. For example, if I upload a file called
foo.bar.jpg, the filename will be rewritten as
foo.bar_.jpg. This occurs both on my local as well as live servers. Has anyone else encountered this and has a solution?
Just in case I'm missing something totally obvious, here's the code to upload files:
Code:
function upload()
{
$this->load->library('upload', array(
'upload_path' => $this->dir,
'allowed_types' => 'jpg|gif|png|txt|pdf'
));
$this->lang->load('upload_file');
if ( ! $this->upload->do_upload('upload'))
{
show_error($this->upload->display_errors('<p>', '</p>'));
exit;
}
else
{
$data = $this->upload->data();
set_flash(sprintf($this->lang->line('upload_complete'), $data['file_name']));
redirect($this->l10n->code().'admin/files/index', 'Location');
}
}