Mr. Tono's table: files read with the real FileReader and Blob, as text, a data URL or bytes, stepped in the browser's order. An interactive FileReader API…
Every upload form, photo preview before sending, or CSV import reads a file in the browser. Misreading when the result comes and what shape it has gives puzzling bugs: null though it was read, a picture turned into broken characters, a page made heavy by a huge data URL.
The same bytes, three shapes, and all of them arrive later
reader.result right after readAsText(): it is null FileReader works asynchronously. The result exists only inside reader.onload (or use await berkas.text()); read before that, reader.result is still null.readAsText comes out as broken characters Binary bytes are not UTF-8 text: what cannot be read becomes �. For a preview use readAsDataURL, or the lighter URL.createObjectURL(berkas).URL.createObjectURL(berkas) (a short address, not a copy), then URL.revokeObjectURL once used.reader.result right after readAsText It prints null: the result only exists at load.padi.png with readAsText Broken characters: a picture is not UTF-8 text.readAsArrayBuffer 15 bytes for 14 characters.