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

Fileexist para ruta web

Estas en el tema de Fileexist para ruta web en el foro de ASP Clásico en Foros del Web. Me gustaría saber si puedo usar Fileexist en una ruta web, ejemplo: "http://www.juanito.com/pruebas/pepe.asp" La verdad es que lo he intentado de distintas formas y siempre ...
  #1 (permalink)  
Antiguo 20/11/2008, 00:46
 
Fecha de Ingreso: noviembre-2008
Mensajes: 1
Antigüedad: 16 años, 5 meses
Puntos: 0
Pregunta Fileexist para ruta web

Me gustaría saber si puedo usar Fileexist en una ruta web, ejemplo:

"http://www.juanito.com/pruebas/pepe.asp"

La verdad es que lo he intentado de distintas formas y siempre arroja False

Ayuda porfa...

Gracias

  #2 (permalink)  
Antiguo 20/11/2008, 05:34
Avatar de Muzztein  
Fecha de Ingreso: agosto-2002
Ubicación: Hangar 18
Mensajes: 1.703
Antigüedad: 22 años, 8 meses
Puntos: 16
Respuesta: Fileexist para ruta web

nop.

Cita:
The FileExists method returns a Boolean value that indicates whether a specified file exists. It returns True if the file exists and False if not.

Syntax
FileSystemObject.FileExists(filename)

Parameter Description
filename Required. The name of the file to check if exist

Example
<%
dim fs
set fs=Server.CreateObject("Scripting.FileSystemObject ")
if fs.FileExists("c:\asp\introduction.asp")=true then
response.write("File c:\asp\introduction.asp exists!")
else
response.write("File c:\asp\introduction.asp does not exist!")
end if
set fs=nothing
%>
Sin embargo puedes usar Server.MapPath("./pruebas/pepe.asp")
para transformar la ruta de logica a fisica.

sin embargo, esto no te permite saber si es que existe un archivo en otro web.
  #3 (permalink)  
Antiguo 20/11/2008, 05:39
Avatar de Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 18 años, 4 meses
Puntos: 126
Respuesta: Fileexist para ruta web

Bienvenido al foro

Prueba con esto

Código asp:
Ver original
  1. Set fs=Server.CreateObject("Scripting.FileSystemObject")
  2.  
  3. if (fs.FileExists(Server.Mappath("./prueba/pepe.asp")) Then
  4.       Response.Write "True"
  5. else
  6.       Response.Write "False"
  7. end if
  8. set fs=nothing

Suerte

EDITO: !Que lento soy¡
__________________
Los formularios se envían/validan con un botón Submit
<input type="submit" value="Enviar" style="background-color:#0B5795; font:bold 10px verdana; color:#FFF;" />
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 08:06.