$('input').change(function(e) { var file = this.files[0]; name = file.name; type = file.type; size = file.size; var url = URL.createObjectURL(file); var img = new Image(); img.onload = function() { console.log(img); var msg = []; msg.push("name = " + file.name); msg.push("type = " + file.type); msg.push("size = " + file.size); msg.push("width = " + img.width); msg.push("height = " + img.height); alert(msg.join("\n")); }; img.src = url; });
<input type="file" accept="image/*">