I use Uploadify to upload multiple pictures to server.
I want to display pictures thumbnails before the pictures are actually uploaded to the server, based on this. I use Firefox 3.6.6.
Here is how I thought to do this:
$('#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 crash, I believe, is that fileObj
is not really a file
like here.
Does anyone know how to get the real file
when using Uploadify ?
I really need any advice, because I'm totally stuck with this !
Thank you very much, good people.