3min chapter

Syntax - Tasty Web Development Treats cover image

Web Streams Explained

Syntax - Tasty Web Development Treats

CHAPTER

How to Use File Reader as a Stream?

file reader is a stream. You can access that file in the browser with the file reader api, right? Um, but you can also just Take that input grab the the file that you want So there's a dot files property on inputs that are type of file And then just call the dot stream method on it and that will Start to stream that file in from your user's computer into the browser. That's really handy if you want to Crop or resize a file but without having to send it someone might upload a 20 meg File right from their their phone. It's kind of a lot of bandwidth send that to your server just to resize it so you can stream it into the browser

00:00

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode