Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   HTML, Javascript y otros (https://www.clubdelphi.com/foros/forumdisplay.php?f=38)
-   -   descarga de URL (https://www.clubdelphi.com/foros/showthread.php?t=63738)

jfadelphi 28-02-2009 14:59:12

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.

jfadelphi 28-02-2009 15:00:13

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"
%>


La franja horaria es GMT +2. Ahora son las 11:23:56.

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