protected function sendRequestFileUpload($b64hash, $type, $size, $filepath, $to, $caption = '')
    {
        $id = $this->createIqId();

        if (!is_array($to)) {
            $to = $this->getJID($to);
        }

        $mediaNode = new ProtocolNode('media', [
            'hash'  => $b64hash,
            'type'  => $type,
            'size'  => $size,
        ], null, null);

        $node = new ProtocolNode('iq', [
            'id'    => $id,
            'to'    => Constants::WHATSAPP_SERVER,
            'type'  => 'set',
            'xmlns' => 'w:m',
        ], [$mediaNode], null);

        //add to queue
        $messageId = $this->createMsgId();
        $this->mediaQueue[$id] = [
            'messageNode' => $node,
            'filePath'    => $filepath,
            'to'          => $to,
            'message_id'  => $messageId,
            'caption'     => $caption,
        ];

        $this->sendNode($node);
        $this->waitForServer($id);

        // Return message ID. Make pull request for this.
        return $messageId;
    }