Overwrite default files on project creation
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user