Skip to content

Instantly share code, notes, and snippets.

@d33pfri3d
Created June 8, 2012 13:31
Show Gist options
  • Save d33pfri3d/2895628 to your computer and use it in GitHub Desktop.
Save d33pfri3d/2895628 to your computer and use it in GitHub Desktop.
preview D&D
function readFiles(files){
for (var i = 0; i < files.length; i++){
preview(files[i]);
}
}
function preview(file){
var reader = new FileReader();
reader.onload = function (event) {
var image = new Image();
img.src = event.target.result;
holder.appendChild(image);
};
reader.readAsDataURL(file);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment