Skip to content
Download Beeper

Serve an asset

$client->assets->serve(string url): void
GET/v1/assets/serve

Stream a file given an mxc://, localmxc://, or file:// URL. Downloads first if not cached. Supports Range requests for seeking in large files.

ParametersExpand Collapse
url: string

Asset URL to serve. Accepts mxc://, localmxc://, or file:// URLs.

Serve an asset

<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

$client = new Client();

$result = $client->assets->serve(url: 'x');

var_dump($result);
Returns Examples