Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > HTML, Javascript y otros
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 28-02-2009
jfadelphi jfadelphi is offline
Miembro
 
Registrado: sep 2008
Posts: 35
Poder: 0
jfadelphi Va por buen camino
Smile descarga de URL

Hola!

Tengo este código en asp.
Mi finalidad es poder bajarme una pagina .htm sin que esta se abra.

<<A href="mailto:%@LANGUAGE="VBSCRIPT">%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Documento sin t&iacute;tulo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
sub get_html (up_http, down_http)
' Uso el objeto XMLHTTP
dim xmlhttp
set xmlhttp = createobject("msxml2.xmlhttp.3.0")

' Abro el fichero de la url
xmlhttp.open "get", up_http, false
xmlhttp.send
dim fso

' Me preparo para guardarlo.
set fso = createobject ("Scripting.FileSystemObject")

' Lo guardo
dim newfile

set newfile = fso.CreateTextFile("c:\tmp\pepe.htm", true)

newfile.write (xmlhttp.responseText)
newfile.close

set newfile = nothing
set xmlhttp = nothing
end sub

get_html "http://www.midominio.com/pruebas/prueba.htm","c:\tmp\pepe.htm"
%>

</body>
</html>



Pero en el momento en que intento guarda el fichero, me da error en la linea:
set newfile = fso.CreateTextFile("c:\tmp\pepe.htm", true)

Me dice: Permiso denegado.

Si alguien sabe que puede pasar o tiene alguna idea para conseguir lo que quiero hacer, le estaría muy agradecido.
Responder Con Cita
  #2  
Antiguo 28-02-2009
jfadelphi jfadelphi is offline
Miembro
 
Registrado: sep 2008
Posts: 35
Poder: 0
jfadelphi Va por buen camino
perdón

No sale el código que he puesto.
ver ahora.

<%
sub get_html (up_http, down_http)
dim xmlhttp
set xmlhttp = createobject("msxml2.xmlhttp.3.0")

xmlhttp.open "get", up_http, false
xmlhttp.send
dim fso
set fso = createobject ("Scripting.FileSystemObject")
dim newfile
set newfile = fso.CreateTextFile("c:\tmp\pepe.htm", true)

newfile.write (xmlhttp.responseText)
newfile.close

set newfile = nothing
set xmlhttp = nothing
end sub
get_html "http://www.midominio.com/pruebas/prueba.htm", "c:\tmp\pepe.htm"
%>
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Descarga FTP Luis Alberto Internet 26 20-03-2012 18:51:47
Descarga de Kylix3 samuelabad Lazarus, FreePascal, Kylix, etc. 39 10-09-2007 11:50:34
Validar una descarga arespremium PHP 1 28-08-2007 23:45:50
link de descarga por SMS? d-hugo Varios 0 26-04-2007 22:27:29
Descarga BDE Tejares Conexión con bases de datos 5 13-06-2006 11:29:22


La franja horaria es GMT +2. Ahora son las 17:30:21.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi