FtpClient\FtpClient::putFromString PHP Method

putFromString() public method

Uploads a file to the server from a string.
public putFromString ( string $remote_file, string $content ) : FtpClient
$remote_file string
$content string
return FtpClient
    public function putFromString($remote_file, $content)
    {
        $handle = fopen('php://temp', 'w');
        fwrite($handle, $content);
        rewind($handle);
        if ($this->ftp->fput($remote_file, $handle, FTP_BINARY)) {
            return $this;
        }
        throw new FtpException('Unable to put the file "' . $remote_file . '"');
    }