/** * upload * * @since 3.0.0 */ protected static function _upload() { $filesArray = current(Request::getFiles()); /* upload file */ if (is_uploaded_file($filesArray['tmp_name'])) { if (move_uploaded_file($filesArray['tmp_name'], self::$_configArray['uploadDirectory'] . '/' . $filesArray['name'])) { return json_encode(['location' => self::$_configArray['uploadDirectory'] . '/' . $filesArray['name']]); } } header('http/1.0 404 not found'); }