made change to allow all file types for uploads

This commit is contained in:
hyung-hwan 2011-12-21 16:37:19 +00:00
parent 04bf20fd75
commit d47c681629
3 changed files with 10 additions and 3 deletions

View File

@ -289,7 +289,8 @@ class File extends Controller
$_FILES['file_name']['type'] = $_FILES['file_name']['type'] =
str_replace('\\', '', $_FILES['file_name']['type']); str_replace('\\', '', $_FILES['file_name']['type']);
$config['allowed_types'] = $ext; //$config['allowed_types'] = $ext;
$config['allowed_types'] = '*';
$config['upload_path'] = CODEPOT_FILE_DIR; $config['upload_path'] = CODEPOT_FILE_DIR;
$config['max_size'] = CODEPOT_MAX_UPLOAD_SIZE; $config['max_size'] = CODEPOT_MAX_UPLOAD_SIZE;
$config['encrypt_name'] = TRUE; $config['encrypt_name'] = TRUE;

View File

@ -643,7 +643,8 @@ class Wiki extends Controller
$_FILES[$field_name]['type'] = $_FILES[$field_name]['type'] =
str_replace('\\', '', $_FILES[$field_name]['type']); str_replace('\\', '', $_FILES[$field_name]['type']);
$config['allowed_types'] = $ext; //$config['allowed_types'] = $ext;
$config['allowed_types'] = '*';
$config['upload_path'] = CODEPOT_ATTACHMENT_DIR; $config['upload_path'] = CODEPOT_ATTACHMENT_DIR;
$config['max_size'] = CODEPOT_MAX_UPLOAD_SIZE; $config['max_size'] = CODEPOT_MAX_UPLOAD_SIZE;
$config['encrypt_name'] = TRUE; $config['encrypt_name'] = TRUE;

View File

@ -578,6 +578,11 @@ class CI_Upload {
$this->set_error('upload_no_file_types'); $this->set_error('upload_no_file_types');
return FALSE; return FALSE;
} }
if($this->allowed_types[0] == '*')
{
return true;
}
$ext = strtolower(ltrim($this->file_ext, '.')); $ext = strtolower(ltrim($this->file_ext, '.'));
@ -967,4 +972,4 @@ class CI_Upload {
// END Upload Class // END Upload Class
/* End of file Upload.php */ /* End of file Upload.php */
/* Location: ./system/libraries/Upload.php */ /* Location: ./system/libraries/Upload.php */