Link to home
Start Free TrialLog in
Avatar of d224
d224

asked on

Convert ASP output to static HTML file

I have asp file content static html and asp code.
I want to be able save output of this file to static html file on my server.
Please help.
Avatar of lavinder
lavinder

hi

 try this

dim fso,strm,i

set fso=server.createobject("scripting.filesystemobject")
set strm=fso.createtextfile(server.mappath("output.htm"),true)
strm.writeline "<html><head></head><body>"
strm.writeline "<ol>"
for i=1 to 10
 strm.writeline "<li>" & i & "</li>"
next
strm.writeline "</body></html>"
strm.close
set strm=nothing
set fso=nothing

cheers!!
Avatar of d224

ASKER

Hi lavinder
It's great, but I want redirect existing asp output to text file.
Then just direct your asp to the output stream, something like:

myBody = the asp code (you will need to concatenate your output as the asp generates it and then write it the FSO stream)

then

strm.writeline myBody

(as above).
hi d224

 The code posted above is asp code, you can see that whatever output it is generating, is going to a static html file, you can send the output to html/text or asp file also. Existing asp output ? probably, i am unable to understand your requirement, please explain.

cheers!!
ASKER CERTIFIED SOLUTION
Avatar of apollois
apollois

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Gary
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept Answer by apollois

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
GaryC123
EE Cleanup Volunteer