Post

You can now upload files to @liveblocks.io! If your multiplayer app uses media, archives, or any file, `LiveFile` allows you to upload them directly to your Storage tree. Other users will see the file appear in realtime—like in this @tldraw.com clip. Learn more ↓

3 reposts4 likes

It's quite simple, there's a new `useUploadFile` hook for uploading a file to a room, then attach the file to your Storage tree. Then fetch your file, and get its URL. You can create a download button, or if it's browser compatible (like an image), render it on the page.

You can also upload files from the server, handy if you're doing any back-end processing or AI generation. Call the server-side `mutateStorage` method, and each browser will update in real-time with the image.