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);
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.