Código JS:
$ (". this.files [0]; lector.onload = function (e) {var image = new image (); image.src = e.target.result; image.onload = function () {if (image.width> 128 || image.height> 128) {relleno = falso; alerta ("El tamaño avatar debe estar entre 128x128");} }}; lector.readasdataurl (archivo);} else {// Esta es la versión IE9 $ (". Preview_size_fake"). show (); var objPreviewSizeFake = $ (". oview_size_fake"). get (0); var fileupload = $ (this) .get (0); fileupload.select (); fileUpload.blur (); path = document.selection.createrGe (). Text; if (/"/w/w"/.test(path)) {Path = Path.slice (1, -1);} objPreviewSizeFake.filters.Item ('dximageTransform.microsoft.alphaimageLoader'). src = path; El tamaño debe estar entre 128x128 ");} document.selection.empty ();}}});Código CSS (esto debe escribirse, si no se escribe, el IE no funcionará)
.preview_size_fake { /* Este objeto solo se usa para obtener el tamaño original de la imagen en IE, y no tiene otro propósito* / filtro: progid: dximagetransform.microsoft.alphaimageloader (dimensionmethod = image); Altura: 1px; Visibilidad: Oculta; desbordamiento: oculto; Pantalla: ninguno;}Código HTML:
<input type = "file" name = "avatar"> <img />