
29/04/2003, 08:58
|
 | | | Fecha de Ingreso: abril-2003
Mensajes: 278
Antigüedad: 22 años Puntos: 1 | |
File.Image Type Estimados amigos:
En el siguiente código deseo introducir la opción de que si no es GIF, JPG, PNG o BMP, me devuelva un error "Imagen no aceptada".
No sé cómo hacerlo y he dado miles de vueltas por Internet antes de enviar tal consulta.
Gracias,
Emajesus
-estoy alojado en Brinkster X4-
<%
Set Upload = Server.CreateObject("Persits.Upload.1")
' Limit file size to 20000 bytes, throw an exception if file is larger
Upload.SetMaxSize 20000, True
' Intercept all exceptions to display user-friendly error
On Error Resume Next
Upload.Save "attachfile"
' 8 is the number of "File too large" exception
If Err.Number = 8 Then
Response.Write "El banner que deseas enviar excede la capacidad reservada."
Else
If Err <> 0 Then
Response.Write "Un error ha ocurrido: " & Err.Description
Else
Response.Write "Enviado con éxito"
End If
End If
%> |