Foros del Web » Programando para Internet » ASP Clásico »

Error en FileExists

Estas en el tema de Error en FileExists en el foro de ASP Clásico en Foros del Web. Tengo el siquiente problema no siempre me dice que la foto no existe, por que puede ser ???? Dim ObjetoFSO Set ObjetoFSO = Server.CreateObject("Scripting.FileSystemObject") if ...
  #1 (permalink)  
Antiguo 04/05/2005, 09:07
 
Fecha de Ingreso: mayo-2005
Mensajes: 156
Antigüedad: 19 años, 1 mes
Puntos: 0
Exclamación Error en FileExists

Tengo el siquiente problema no siempre me dice que la foto no existe, por que puede ser ????

Dim ObjetoFSO
Set ObjetoFSO = Server.CreateObject("Scripting.FileSystemObject")

if ObjetoFSO.FileExists("http://www.nombre.com/imagenes/1.gif") then
pinta la foto
else
saca una por defecto
end if

por que no me saca siempre la foto por defecto, si la otra exixte en la web, la ruta de la foto es otra web, y por supuesto no es mia.

muchas gracias
__________________
Programador & Diseñador Web
www.ascariz.es
www.ascariz.com
www.telefonica.net/web/tiempoderol
  #2 (permalink)  
Antiguo 04/05/2005, 09:09
Avatar de Saruman  
Fecha de Ingreso: mayo-2003
Ubicación: Panama city, Panama, Panama
Mensajes: 1.154
Antigüedad: 21 años
Puntos: 5
pregunta.... ¿eso funciona con direcciones de http???
__________________
Saruman

One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them.
  #3 (permalink)  
Antiguo 04/05/2005, 09:20
 
Fecha de Ingreso: mayo-2005
Mensajes: 156
Antigüedad: 19 años, 1 mes
Puntos: 0
Eso es lo que quiero saber yo, si se puede hacer o no.
__________________
Programador & Diseñador Web
www.ascariz.es
www.ascariz.com
www.telefonica.net/web/tiempoderol
  #4 (permalink)  
Antiguo 04/05/2005, 09:27
Avatar de Saruman  
Fecha de Ingreso: mayo-2003
Ubicación: Panama city, Panama, Panama
Mensajes: 1.154
Antigüedad: 21 años
Puntos: 5
bueno, yo lo hago pero ejecutandolo en el mismo server el FSO...
y mandando el path con Server.MapPath().
sobre lo otro nunca lo havia visto o hecho asi... si se puede bueno, ya aprendimos algo no?

quedaria asi:

Código:
Function IsFileExists(strNombre)
	Set FSO = Server.CreateObject("Scripting.FileSystemObject")
		
	if FSO.FileExists(server.MapPath(strNombre)) = true then
		IsFileExists = true
	else
		IsFileExists = false
	end if
				
	set FSO = Nothing
End Function


if IsFileExists("/imagenes/1.gif") = true then
response.write("ok")
else
response.write("nop")
end if
__________________
Saruman

One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them.
  #5 (permalink)  
Antiguo 04/05/2005, 10:06
Avatar de AlZuwaga
Colaborador
 
Fecha de Ingreso: febrero-2001
Ubicación: 34.517 S, 58.500 O
Mensajes: 14.550
Antigüedad: 23 años, 3 meses
Puntos: 535
Cita:
Iniciado por Saruman
pregunta.... ¿eso funciona con direcciones de http???
Respuesta: NO

FSO = File System Object = Objeto del Sistema de Archivos
__________________
...___...
  #6 (permalink)  
Antiguo 04/05/2005, 10:08
Avatar de Saruman  
Fecha de Ingreso: mayo-2003
Ubicación: Panama city, Panama, Panama
Mensajes: 1.154
Antigüedad: 21 años
Puntos: 5
Cita:
Iniciado por Al Zuwaga
Respuesta: NO
gracias, no estaba seguro
__________________
Saruman

One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them.
  #7 (permalink)  
Antiguo 04/05/2005, 11:57
Avatar de sjam7  
Fecha de Ingreso: diciembre-2001
Ubicación: Guadalajara, Mexico
Mensajes: 3.672
Antigüedad: 22 años, 5 meses
Puntos: 16
si no existe una imagen puedes poner que te ponga una por defaul para evitar errores:
Código:
<IMG SRC="imagen.gif"
onerror="this.onerror=null;this.src='http://www.servidor.com/imagenerror.gif';">
__________________
CreandoWebs.com
www.creandowebs.com
PLANTILLAS TEMPLATEMONSTER CON 10% DE DESCUENTO
  #8 (permalink)  
Antiguo 04/05/2005, 12:02
Avatar de Saruman  
Fecha de Ingreso: mayo-2003
Ubicación: Panama city, Panama, Panama
Mensajes: 1.154
Antigüedad: 21 años
Puntos: 5
hey, buen dato sjam7... super cool
esto lo pusiste en los FAG'S?
__________________
Saruman

One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them.
  #9 (permalink)  
Antiguo 04/05/2005, 12:43
Avatar de sjam7  
Fecha de Ingreso: diciembre-2001
Ubicación: Guadalajara, Mexico
Mensajes: 3.672
Antigüedad: 22 años, 5 meses
Puntos: 16
no, ya que eso no es ASP, sino javascript
  #10 (permalink)  
Antiguo 04/05/2005, 12:48
Avatar de Saruman  
Fecha de Ingreso: mayo-2003
Ubicación: Panama city, Panama, Panama
Mensajes: 1.154
Antigüedad: 21 años
Puntos: 5
Cita:
Iniciado por sjam7
no, ya que eso no es ASP, sino javascript
oviamente me referia alla
__________________
Saruman

One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:25.