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
{{ message }}
This repository was archived by the owner on Mar 27, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 27, 2026. It is now read-only.
I am having an issue with trying to get the FileReader working properly. I have some code that is kinda working, and by that I mean when I log the file in FireFox it works somewhat. It shows me the file information but not the data in the file.
Also debugMode set to true doesn't do anything for me. It doesn't show me any debug information. Below is some test code I'm using. Please let me know if my example is wrong. In IE9 it just gives me errors that the target.files isn't populated at all. From some of the research I've done in the issues section here it refers to something called: FileAPIProxy? But when I try to follow that It is undefined.
If you get e.target.files is not an object, it likely means that the path to the filereader (as specified in the init method of fileReader) is not correct. I was having this problem as well and when I fixed that path it started working.
Activity
linusx commentedon Jun 27, 2013
Also e.target.files is not an object in IE9. How would I get the file in IE9?
keowling commentedon Jul 23, 2013
Linusx, I have the same issue. Did you find the solution?
russgove commentedon Jul 23, 2013
I am having this issue in IE9 as well......
linusx commentedon Jul 23, 2013
Here is how I got it to work. This is currently working on IE9 and Safari 5. Hope it helps.
/***************************************************************************************/
reader = new FileReader();
// Hack for IE. IE9 doesn't have filereader or the properties
// Supposed to be included but it doesn't seem to work.
if (is_ie) {
reader.DONE = 2;
}
reader.onload = function (e) { file_loaded(e, 'onload'); };
reader.onloadend = function (e) { file_loaded(e, 'onloadend'); };
reader.readAsText(file);
function file_loaded(e, type) {
if (e.target.readyState === reader.DONE) {
xml = e.target.result;
upload_xml(xml);
}
}
keowling commentedon Jul 23, 2013
Linusx, Thank you for sharing.
By the way, how do we get the "file" in the following line?
reader.readAsText(file);
In IE 9, I did try to get the file from e.target.files, but it complains that e.target.files is not an object in IE9.
Thanks for you help in advanced
javamate commentedon Mar 13, 2014
If you get e.target.files is not an object, it likely means that the path to the filereader (as specified in the init method of fileReader) is not correct. I was having this problem as well and when I fixed that path it started working.