jfadelphi
28-02-2009, 14:59:12
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í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.
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í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.