Photos, videos, audio, voice notes, and documents are never sent inline over the WebSocket. You upload the file over HTTP first, get back an id, then send that id in a message. Going the other way, an incoming message gives you an id you download over HTTP.

That means every media flow is three steps: upload → send the id → the recipient downloads it.


Media Object

Uploading Media Files

Downloading Media Files

generatePermanentUrl