mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 10:22:18 +00:00
- Removed global function uploadFile from application/helpers/hlp_common_helper.php
- Added new protected method uploadFile to application/core/FHC_Controller.php - Replaced global function uploadFile with the protected method FHC_Controller->uploadFile
This commit is contained in:
@@ -423,28 +423,6 @@ function isValidDate($dateString)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility function to upload a file
|
||||
*/
|
||||
function uploadFile($post_field_name, $allowed_types = array('*'))
|
||||
{
|
||||
$ci =& get_instance(); // get CI instance
|
||||
$ci->load->library(
|
||||
'upload',
|
||||
array(
|
||||
'upload_path' => sys_get_temp_dir(),
|
||||
'allowed_types' => $allowed_types,
|
||||
'overwrite' => true
|
||||
)
|
||||
);
|
||||
|
||||
// If the upload was a success then return the uploaded file info
|
||||
if ($ci->upload->do_upload($post_field_name)) return success($ci->upload->data());
|
||||
|
||||
// If an error occurred then return it
|
||||
return error($ci->upload->display_errors('', ''));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// PHP functions that don't exist in older versions
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user