1 var reader = new FileReaderSync();
4 * Expects an object containing a file and an encoding then uses a
5 * FileReaderSync to read the file. Returns an object containing the
6 * file read a binary string, text, url and ArrayBuffer.
8 onmessage = function (event) {
9 var file = event.data.file;
10 var encoding = event.data.encoding;
12 var rtnObj = new Object();
14 if (encoding != undefined) {
15 rtnObj.text = reader.readAsText(file, encoding);
17 rtnObj.text = reader.readAsText(file);
20 rtnObj.bin = reader.readAsBinaryString(file);
21 rtnObj.url = reader.readAsDataURL(file);
22 rtnObj.arrayBuffer = reader.readAsArrayBuffer(file);