Firefox 3.6 crashes when trying to display thumbnail

I use Uploadify to upload multiple images to the server.

I want to display thumbnails of images before the images are actually uploaded to the server, based on this . I am using Firefox 3.6.6.

Here's how I decided to do it:

$('#fileInput').uploadify({
    ...
    onSelect: function(event, queueID, fileObj) {
        var img = document.createElement("img");  
        img.classList.add("obj");  
        img.file = file;  
        document.getElementById("ThumbnailsArea").appendChild(img);  
        var reader = new FileReader();  
        reader.onload = (function(aImg) { return function(e) { aImg.src = e.target.result; }; })(img);  
        reader.readAsDataURL(fileObj); // This crashes Firefox  
        return true;
    }
    ...
});

The reason for the crash, I believe, is that it fileObjis actually not file, for example here .

Does anyone know how to get real filewhile using Uploadify ?

I really need some advice because I'm completely stuck on this!

Thank you, good people.

+3
1

, , , , , , .

, , , , , onchange, . , file javascript-, (FF ).

-, uploadify flash ( script) . Filereference. , , , ( , -, ). , , , onselect onopen event ( 0).

, !

0

Source: https://habr.com/ru/post/1754159/


All Articles