diff --git a/framework/core/Input.php b/framework/core/Input.php index b6d4b57..38d7c7d 100644 --- a/framework/core/Input.php +++ b/framework/core/Input.php @@ -303,18 +303,29 @@ public function getPost($index, $xss_clean = false) } /** - * Handle $_FILES - * + * Get single current uploaded file using $_FILES + * through Http Post * @param string $index * @return array|string */ public function file($index = '') { if ($index !== '') { - return isset($_FILES[$index]); + return $_FILES[$index]; } - return isset($_FILES); + return ''; + } + + /** + * Get all current uploaded files using $_FILES + * through Http Post + * + * @return array + */ + public function files() + { + return $_FILES; } /** @@ -326,8 +337,8 @@ public function file($index = '') public function hasFile($file) { return (empty($file['name'])) - ? true - : false; + ? false + : true; } /** @@ -338,7 +349,7 @@ public function hasFile($file) * @param string $name * @return string */ - public function storeFile($file, $path = '', $name = null) + public function storeFile($file = [], $path = '', $name = null) { if (empty($file)) { return '';