Re: saving current asp to server

From: Ray Costanzo [MVP] (my)
Date: 10/01/04


Date: Fri, 1 Oct 2004 09:48:01 -0400

Unfortunately, there isn't any functionality in ASP like:

sHTML = Response

What you'd have to do instead, as one option, is use something like this,
http://www.aspfaq.com/show.asp?id=2173 (first code snippet), but instead or
Response.Writing the .ResponseText, write the ResponseText into a file.

Ray at work

"LC" <lc@hotmail.com> wrote in message
news:2d5d01c4a7bb$32746bb0$a601280a@phx.gbl...
> Hi,
>
> Many Weeks ago I posted this:
> I would like to know how I can save my current ASP page
> to the server side in html file format.
>
> I got a very nice reply back from Scott McNair. Thank
> you very much Scott.
>
> This code was provided by Scott:
> <%
> 'DEFINE YOUR FILE/FOLDER STUFF HERE
> Dim Folder, File, WebPage
> Folder = "E:\HRForms"
> File = "test.html"
> WebPage = "http://uspa011410/hr/PrintChangeStatus2.asp"
>
> 'BUILD YOUR WEBPAGE HERE
> Randomize
> Write "The current time is: " & Now() & "<br>"
> Write "Here's a random number: " & Int(Rnd(1)*500)+1
> & ".<br>"
> Write "why doesnt this work"
>
> 'I like how it boils down to this one line:
> Save WebPage
>
> 'SUBROUTINES
> Sub Write(myText)
> 'This sub is mainly here to cut down on the
> 'wear and tear of having to put this junk
> 'on every single line you want to append
> 'to the code, and to make sure it's easily
> 'readable when you view source
>
> WebPage = WebPage & myText & vbcrlf
> End Sub
>
> Sub Save(myText)
> 'Creates the file in the location specified, and
> 'populates it with whatever is passed to it
>
> Dim FSO, Stream, Overwrite, Unicode
> Overwrite = True
> Unicode = False
> Set FSO = Server.CreateObject
> ("Scripting.FileSystemObject")
> Set Stream = FSO.CreateTextFile(Folder & File,
> Overwrite, Unicode)
> Stream.Write myText
> Stream.Close
> End Sub
>
>
> %>
>
> However, I have a pre-developed ASP that contains all the
> information I need. As soon as that page loads up I want
> that ASP to be saved as a html file.
>
> If Scott or anyone can help me with this, I very much
> appreciate it.
>
> Thanks.
> LC
>
>



Relevant Pages

  • saving current asp to server
    ... to the server side in html file format. ... I got a very nice reply back from Scott McNair. ... Sub Write ... I have a pre-developed ASP that contains all the ...
    (microsoft.public.inetserver.asp.general)
  • Re: Wscript within VBA
    ... It posts a form to an ASP page, ... Since what you want to do sounds like it will require admin privileges, ... server to impersonate an admin account. ... >> Exit Sub ...
    (microsoft.public.vb.database)
  • Procedures dont have access to public Variables in ASP
    ... The problem is when running in ASP ... my .vbs file which is on the server using wscript or cscript all is fine. ... The only difference is the QuitOnError() procedure. ... sub SendEmail ...
    (microsoft.public.scripting.vbscript)
  • Re: Redirecting web pages
    ... processor only processes ASP code if the extension is .asp. ... since they are included in .asp files, are not required to be .asp files so ... Response.Writeend sub ...
    (microsoft.public.scripting.vbscript)
  • Re: FileSystemObject-Invalid procedure call or arg
    ... When running the code via the .vbs file it breaks at about 1.5 Mb. ... In fact I have created files roughly 5Mb in size no problem from .asp. ... > Dim sStuffing ... >> End Sub ...
    (microsoft.public.scripting.vbscript)