Overwrite default files on project creation

This commit is contained in:
Eike Foken
2011-08-30 22:31:45 +02:00
parent 665b683425
commit b6d57bd563

View File

@@ -71,10 +71,11 @@ class Projects extends CI_Controller {
$config = array(
'upload_path' => $projectPath,
'allowed_types' => '*',
'overwrite' => true,
);
$this->load->library('upload', $config);
if (!empty($_FILES['defaultmodel']['tmp_name'])) {
if ($_FILES['defaultmodel']['tmp_name'] != '') {
$config['file_name'] = 'defaultmodel';
$this->upload->initialize($config);
@@ -82,7 +83,7 @@ class Projects extends CI_Controller {
$this->messages->add(_('The default model could not be uploaded.'), 'error');
}
}
if (!empty($_FILES['defaultconfig']['tmp_name'])) {
if ($_FILES['defaultconfig']['tmp_name'] != '') {
$config['file_name'] = 'defaultconfig';
$this->upload->initialize($config);