AVapps / FileReader

A FileReader polyfill for Internet Explore and Safari using Flash
192 stars 63 forks source link

Bug with multiple use of fileReader() ? #42

Open Epiju opened 11 years ago

Epiju commented 11 years ago

Hi everyone,

I'm using Jahdrien's FileReader (many thanks!) but I think I have a problem with calling fileReader() multiple times in my JS file.

I'm using it in a Rails app, i'm using CoffeeScript for the JS part. I'm trying to preview images with IE9.

I have multiple input and I'm calling multiple times the function fileReader() but when I do so it seems to break stuff... Do someone had the same issue?

previewImage = (event) ->
 * do stuff *

$input = $("#my_input")
$input.fileReader()
$input.change (event) ->
   previewImage(event)

It works fine.

But then I add :

anotherPreviewImage = (event) ->
 * do stuff *

$anotherInput = $("#my_input2")
$anotherInput.fileReader()
$anotherInput.change (event) ->
   anotherPreviewImage(event)

And the whole thing doesn't work anymore on IE9...

Thanks for helping me!

emelineL commented 10 years ago

Hi,

I am experiencing the same kind of trouble. I instantiate 2 fileReaders on the same page, and only the second one is working.

$('file-uploader-before').fileReader({
     id: 'file-uploader-before-iesupport',
     debugMode: this.DEBUG,
     filereader: '/flash/filereader.swf',
     expressInstall: '/flash/expressInstall.swf'
});
$('file-uploader-after').fileReader({
   id:  'file-uploader-after-iesupport',
   debugMode: this.DEBUG,
   filereader: '/flash/filereader.swf',
   expressInstall: '/flash/expressInstall.swf'
});

Thanks !