O'Reilly logo

WebRTC Blueprints by Andrii Sergiienko

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introducing the HTML5 File API

Data channels help us to transmit data (files) between peers. Nevertheless, it doesn't provide any mechanism to read and write files. So, we need some mechanism to be able to read/write files.

For the purpose of filesystem access, we will use the HTML5 File API. It provides a standard way to interact with local files. Using this API, you can create and read files, create thumbnails for image files, save application preferences, and more. You can also verify on the client side; if a customer wants to upload the MIME type of file, you can restrict the uploading by the file size.

When reading files, we will use the FileReader object. It reads files asynchronously and provides the following four ways (methods) to read ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required