Overwrite default files on project creation
This commit is contained in:
@@ -71,10 +71,11 @@ class Projects extends CI_Controller {
|
|||||||
$config = array(
|
$config = array(
|
||||||
'upload_path' => $projectPath,
|
'upload_path' => $projectPath,
|
||||||
'allowed_types' => '*',
|
'allowed_types' => '*',
|
||||||
|
'overwrite' => true,
|
||||||
);
|
);
|
||||||
$this->load->library('upload', $config);
|
$this->load->library('upload', $config);
|
||||||
|
|
||||||
if (!empty($_FILES['defaultmodel']['tmp_name'])) {
|
if ($_FILES['defaultmodel']['tmp_name'] != '') {
|
||||||
$config['file_name'] = 'defaultmodel';
|
$config['file_name'] = 'defaultmodel';
|
||||||
$this->upload->initialize($config);
|
$this->upload->initialize($config);
|
||||||
|
|
||||||
@@ -82,7 +83,7 @@ class Projects extends CI_Controller {
|
|||||||
$this->messages->add(_('The default model could not be uploaded.'), 'error');
|
$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';
|
$config['file_name'] = 'defaultconfig';
|
||||||
$this->upload->initialize($config);
|
$this->upload->initialize($config);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user