Bitrix API

Sftp

Class Sftp Transfer files via sftp

Table of Contents

Methods

__construct()  : mixed
Constructor.
connect()  : mixed
Makes connection via SFTP
downloadFile()  : mixed
getFileSize()  : int
getFilesList()  : array<string|int, mixed>
uploadFile()  : mixed

Methods

__construct()

Constructor.

public __construct(string $login, string $pass, string $host, int $port[, string $fingerprint = "" ]) : mixed
Parameters
$login : string

Sftp login.

$pass : string

Sftp password.

$host : string

Sftp host.

$port : int

Sftp port.

$fingerprint : string = ""

Hostkey hash.

connect()

Makes connection via SFTP

public connect() : mixed
Tags
@return

bool.

throws
SystemException

downloadFile()

public downloadFile(string $remoteFile, string $localFile) : mixed
Parameters
$remoteFile : string

Path to remote file.

$localFile : string

Path to local file.

Tags
@return

bool.

throws
SystemException

getFileSize()

public getFileSize(string $remoteFile) : int
Parameters
$remoteFile : string

Remote file.

Return values
int

Filesize.

getFilesList()

public getFilesList(string $remotePath) : array<string|int, mixed>
Parameters
$remotePath : string

Remote path.

Tags
throws
SystemException
Return values
array<string|int, mixed>

List of files from remote path.

uploadFile()

public uploadFile(string $localFile, string $remoteFile) : mixed
Parameters
$localFile : string

Path to local file.

$remoteFile : string

Path to remote file.

Tags
@return

bool.

throws
SystemException

        
On this page

Search results