Filereader or IE9 alternative

Asked

Viewed 233 times

1

The Filereader object allows web applications to asymptotically read the contents of the files (or pure data buffers) of the user’s computer. The following supported browser are:

Firefox (Gecko) - 3.6 (1.9.2) 
Chrome - 7 
Internet Explorer - 10     
Opera - 12.02
Safari - 6.0.2

I am developing an import where I read a file and turn it into Base64 that to IE10 works perfectly, need the same solution for IE9.

3 answers

2

You can check if Filereader is browser-enabled and if you are not using an alternative option:

if ('FileReader' in window) {
  // Faça algo se FireReader for suportado
} else {
  // Faça algo caso o FireReader não for suportado.
}

Possible solution compatible with IE8 > Filereader Remember, this solution uses jQuery and Flash.

Reference: How to get Cross Browser Compatibilty for window.fileReader API of HTML5

  • I saw that there is Activexobject would be a better solution?

2

According to the documentation of MDN of API File is supported by the following browsers:

  • Chrome version 13
  • Firefox (Gecko) version 3.0 (1.9)
  • Internet Explorer version 10.0
  • Opera version 11.5 (Presto)
  • Safari (Webkit) version 6.0

So natively you won’t be able to solve this, because it’s a limitation (hadn’t been implemented yet), however there are fallbacks, for example in Flash.

Many keep talking Flash will die or died, ok agree, but this is a case of disuse and not that died for real, still at Desktops you can use it as fallback for various things

An example of great alternatives:

See more Polyfills in the repository of Modernizr:

1

First I’d like to remind you of the greatest achievement in years:

Internet Explorer End of Support

So why does it support a browser that is no longer supported by the manufacturer?

In any case, you can use a Polyfill for the File API:

  • I saw that there is Activexobject would be a better solution?

  • If you do not want to support other browsers such as Chrome, Opera, Firefox and MS Edge, it is an option, but do not recommend

  • Would you have an example of how to implement using Activexobject? Because it always gives the error "The automation server cannot create object".

Browser other questions tagged

You are not signed in. Login or sign up in order to post.