Guardar html en el servidor
Mi problema es el siguiente:
Necesito guardar en el servidor el archivo generado por un ASP y no se como hacerlo.
Muchas gracias a todos.
Necesito guardar en el servidor el archivo generado por un ASP y no se como hacerlo.
Muchas gracias a todos.
Joder, tio, como dices algo tan general, asi no podemos ayudarte, ASP no puede generar cualquier tipo de archivo, quizas un TXT plano, o q?? pon el ejemplo claro para poder ayudarte!
Suerte
Suerte
utiliza este código, te puede dar alguna idea al respecto.
Saludos desde Perú.
<% LANGUAJE="VBSCRIPT"%>
<html>
<head>
<meta http-equiv="Content-Language" content="es">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<%
Dim intMSG, strMSG
intMSG=1234
strMSG="HOLA ESTA ES UNA PRUEBA"
CreateFile("d:inetpubwwwrootbalotariovariables.txt")
%>
<body>
hola <%=time %>
<%
sub CreateFile(path)
dim fs, file
' Response.Write("<b>CreateFile:</b><br>")
set fs = CreateObject("Scripting.FileSystemObject")
'If the file already exists give an error message.
if fs.FileExists(path) then
WriteFile(path)
'Otherwise create it and write some data to it.
else
' Response.Write("Creating " & filename & ".<br>")
set file = fs.CreateTextFile(path)
' Response.Write("Writing data to " & filename & ".<br>")
file.WriteLine("strMSG=" & strMSG & time & "&" & "intMSG=" & intMSG)
file.Close()
end if
end sub
sub WriteFile(path)
dim fs, file
' Response.Write("<b>WriteFile:</b><br>")
set fs = CreateObject("Scripting.FileSystemObject")
'If the file doesn't exist give an error message.
if not fs.FileExists(path) then
Response.Write("File " & filename & " does not exist, write aborted.<br>")
'Otherwise, overwrite the contents.
else
set file = fs.OpenTextFile(path, 2)
' Response.Write("Rewritng file " & filename & ".<br>")
file.WriteLine("strMSG=" & strMSG & time & "&" & "intMSG=" & intMSG)
file.Close()
end if
end sub
%>
<p> </p>
</body>
</html>
Saludos desde Perú.
<% LANGUAJE="VBSCRIPT"%>
<html>
<head>
<meta http-equiv="Content-Language" content="es">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<%
Dim intMSG, strMSG
intMSG=1234
strMSG="HOLA ESTA ES UNA PRUEBA"
CreateFile("d:inetpubwwwrootbalotariovariables.txt")
%>
<body>
hola <%=time %>
<%
sub CreateFile(path)
dim fs, file
' Response.Write("<b>CreateFile:</b><br>")
set fs = CreateObject("Scripting.FileSystemObject")
'If the file already exists give an error message.
if fs.FileExists(path) then
WriteFile(path)
'Otherwise create it and write some data to it.
else
' Response.Write("Creating " & filename & ".<br>")
set file = fs.CreateTextFile(path)
' Response.Write("Writing data to " & filename & ".<br>")
file.WriteLine("strMSG=" & strMSG & time & "&" & "intMSG=" & intMSG)
file.Close()
end if
end sub
sub WriteFile(path)
dim fs, file
' Response.Write("<b>WriteFile:</b><br>")
set fs = CreateObject("Scripting.FileSystemObject")
'If the file doesn't exist give an error message.
if not fs.FileExists(path) then
Response.Write("File " & filename & " does not exist, write aborted.<br>")
'Otherwise, overwrite the contents.
else
set file = fs.OpenTextFile(path, 2)
' Response.Write("Rewritng file " & filename & ".<br>")
file.WriteLine("strMSG=" & strMSG & time & "&" & "intMSG=" & intMSG)
file.Close()
end if
end sub
%>
<p> </p>
</body>
</html>