public function uploadFile($pathFrom, $pathTo)
    {
        if ( ! $localStream = @fopen($pathFrom, 'r')) {

            throw new SftpLocalFileException("Unable to open local file: '{$pathFrom}'.");
        }

        if ( ! $remoteStream = @fopen("ssh2.sftp://{$this->ftpConnection}/{$pathTo}", 'w')) {

            throw new SftpRemoteFileException("Unable to open remote: '{$pathTo}'.");
        }

        // write from our remote stream to our local stream
        $buffer       = stream_get_contents($localStream);
        $bytesWritten = strlen($buffer);

        if (fwrite($remoteStream, $buffer) === false) {

            throw new SftpLocalFileException("Unable to write to remote file: '{$pathTo}'.");
        }

        fclose($localStream);
        fclose($remoteStream);

        event( new SshFileUploaded(basename($pathFrom), $pathTo, $bytesWritten) );

        return $bytesWritten;
    }