Chapter 10

Working With Files

Examples

Recipe 10.1
Loading Text From a File

Load text data from a file into the page.

Recipe 10.2
Loading an Image as a Data URL

Load image data from a file into the page.

Recipe 10.3
Loading a Video as an Object URL

Load a video into a video element.

Recipe 10.4
Reading a File with Drag and Drop

Read a file by dropping it into the browser window.

Recipe 10.5
Checking and Requesting Permissions

Check and/or request permissions for a selected file.

Recipe 10.6
Exporting API Data to a File

Call a remote API, then export the JSON data to a local file.

Recipe 10.7
Exporting API Data With a Download Link

Call a remote API, then export the JSON data by triggering a file download.

Recipe 10.8
Uploading a File with Drag and Drop

Upload a dropped file using the Fetch API.

Web API Cookbook
Joe Attardi