FtpClient\FtpClient::putFromPath PHP Method

putFromPath() public method

Uploads a file to the server.
public putFromPath ( string $local_file ) : FtpClient
$local_file string
return FtpClient
    public function putFromPath($local_file)
    {
        $remote_file = basename($local_file);
        $handle = fopen($local_file, 'r');
        if ($this->ftp->fput($remote_file, $handle, FTP_BINARY)) {
            rewind($handle);
            return $this;
        }
        throw new FtpException('Unable to put the remote file from the local file "' . $local_file . '"');
    }