JavaScript enables you to read a file in several ways. The FileReader object is the most flexible. You can instruct it to read a file as an array buffer, a data URL, or text.