public function get_file($reference, $saveas = '') {
        $unpacked = $this->unpack_reference($reference);

        // This is a shared link, and hopefully it is still active.
        $downloadlink = $this->get_file_download_link($unpacked->url);

        $saveas = $this->prepare_file($saveas);
        file_put_contents($saveas, fopen($downloadlink, 'r'));

        return ['path' => $saveas];
    }