/** * Put file to a sftp location * @param string $localFile Local file path * @param string $remoteFile Remote file path or content * @param integer $mode (1 - local file, 2 - string) * @return bool true if file send success * @throws CException if file transfer fails */ public function sendFile($localFile, $remoteFile, $mode = 1) { if ($this->objSftp->put($remoteFile, $localFile, $mode)) { return true; } else { throw new CException(Yii::t('XSFtp.sftp', 'File send failed.')); } }