You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to build an webapp to open some text files saved in the filesystem. and I decided to use this library to be able to use my app on FF17b (next step will be try to add IndexedDb Shim to enable WebSQL fallback).
My code works fine in Chrome, but I receive an error when I try to open a file on Firefox.
and the error I receive is :NS_ERROR_FAILURE: Failure arg 0 [nsIDOMFileReader.readAsText]
The line the error refers to is reader.readAsText(file,'ISO-8859-1');
I tried some debugging in Firebug and I discovered that object "file" has correct "name" but size 0, empty type and null "blob_", and nothing more.
Am I doing something wrong or is it a problem with the library?
The text was updated successfully, but these errors were encountered:
I encountered the same issue for empty files. To me it seems that this is the culprit:
// If we're returning a zero-length (empty) file, return the fake file obj.// Otherwise, return the native File object that we've stashed.varfile=this.file_.blob_==null ? this.file_ : this.file_.blob_;
The problem is that "this.file_" is later passed to the reader and not recognized by it (it's not the native File representation). It doesn't make terrible sense to read empty file, but semantically such operation is correct and in my case the operation is performed by 3rd party code so I cannot avoid it either.
I'm trying to build an webapp to open some text files saved in the filesystem. and I decided to use this library to be able to use my app on FF17b (next step will be try to add IndexedDb Shim to enable WebSQL fallback).
My code works fine in Chrome, but I receive an error when I try to open a file on Firefox.
Here is my code:
and the error I receive is :
NS_ERROR_FAILURE: Failure arg 0 [nsIDOMFileReader.readAsText]
The line the error refers to is
reader.readAsText(file,'ISO-8859-1');
I tried some debugging in Firebug and I discovered that object "file" has correct "name" but size 0, empty type and null "blob_", and nothing more.
Am I doing something wrong or is it a problem with the library?
The text was updated successfully, but these errors were encountered: