
19/03/2003, 13:53
|
 | | | Fecha de Ingreso: diciembre-2002 Ubicación: sinaloa, mx
Mensajes: 37
Antigüedad: 22 años, 5 meses Puntos: 0 | |
ke onda, si mira la manera mas facil es poner javascript en el lado de cliente... en el lado donde tienes tu formulario pon esto
<code>
extArray = new Array(".gif", ".jpg");
function LimitAttach(form, file) {
allowSubmit = false;
if (!file) return;
while (file.indexOf("\\") != -1)
file = file.slice(file.indexOf("\\") + 1);
ext = file.slice(file.indexOf(".")).toLowerCase();
for (var i = 0; i < extArray.length; i++) {
if (extArray[i] == ext) { allowSubmit = true; break; }
}
if (allowSubmit) form.submit();
else
alert("Se permiten únicamente archivos con la extensión: "
+ (extArray.join(" ")) + "\nPor favor, seleccione otro archivo "
+ "e intente de nuevo.");
}
</code>
y al boton de submit le vas agregar esto...
<code> onclick="LimitAttach(this.form, this.form.ruta.value)"
</code>
ahi puedes modificar el arreglo de tipos permitidos para poder subir mas de uno... yo tmb utilizo el aspupload ... =) |