Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    1

    Unanswered: Saving File to Server

    Hi All,

    What Im trying to do is, after the page is printed in users IE, it saves the HTML page in the server.

    Doing something like this, its just too much ugly for my code:

    -----------------------
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set stream = fs.CreateTextFile(Server.MapPath( "\teste.html" ))
    stream.Write "Line1"
    stream.Write "Line2"
    stream.Close
    -----------------------

    Isnt there a way to save the whole thing in a file?
    I got something like this, and it works for external sites.

    -----------------------
    Dim objIE, fs, stream
    Set objIE = CreateObject("InternetExplorer.Application")
    objIE.Visible = True
    objIE.Navigate("http://www.google.com")
    Do While objIE.Busy
    Loop
    Do While objIE.Document.readyState<>"complete"
    Loop
    '
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set stream = fs.CreateTextFile(Server.MapPath( "\teste.html" ))
    stream.Write objIE.document.body.innerHTML
    stream.Close
    ------------------

    I want to do the exact thing in the current page!

    Thanx,
    eddie...

  2. #2
    Join Date
    Jan 2004
    Location
    Bermuda
    Posts
    40

    Re: Saving File to Server

    Eddie:

    Have you tried the XMLHTTP object?

    RobbieD
    Sunny Times...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •