2

I am developing an epub reader in js. My app works on chrome 35 and recent browsers but not the old ones (ex: safari 5). I got this error "can't find variable FileReader" which occurs when I attempt to read a Blob.

var reader = new FileReader();
reader.readAsArrayBuffer(blob);

I am searching for an alternative to FileReader. I tried to use FileAPI instead which provides a readAsArrayBuffer method too :

var reader = FileAPI;
reader.readAsArrayBuffer(blob, function(e) {
    console.debug(e);
});

but console.debug returns : Object {type: "error", target: Blob, result: undefined, error: "filreader_not_support_BinaryString"}

I found this polyfill : https://github.com/Jahdrien/FileReader but I avoid using jquery. Thanks for your help.

4

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.