upload($params['type'], $file); $result = null; if ($info) { // $attachment_model = new CoreAttachment(); // $result = $attachment_model->createAttach($info); if ($info['driver'] === 'local') { $result = 'https://' . $_SERVER['HTTP_HOST'] . '/' . $info['attachment']; } } return $result; } }