In Gecko/Firefox I got the error message:
TypeError: fr.readAsDataurl is not a function
Using the following JavaScript:
var fr = new FileReader();
fr.readAsDataURL(files[i]);
As it turns out someone at Mozilla created the deprecated method readAsDataurl
with the improper letter casing and since JavaScript is case sensitive I simply had to use the readAsDataURL
method (uppercase URL):
if (fr.readAsDataURL) {fr.readAsDataURL(files[i]);}
else if (fr.readAsDataurl) {fr.readAsDataurl(files[i]);}
Note that the standard/proper casing method is detected first. If you want your code to work as quickly as possible performance will improve over time as standards support improves.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With