Saving a file as HTML


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Saving a file as HTML

  1. #1
    ILA SINGH Guest

    Saving a file as HTML


    Hi!
    Could you please help us out with this...
    How can we save a dynamically generated report,viewed in a browser, as an
    "HTML file" on to our server(Win NT).

    We are working with Coldfusion which is same as ASP as far as logic comes.

    We want to code it and not use 'save as' from the browser.
    Thankyou
    Have a nice day.
    Ila Singh


  2. #2
    Rich Guest

    Re: Saving a file as HTML


    There are many of ways of doing this. One way is that you can create a session
    variable that will contain the HTML string. And then instantiate the File
    Scripting Object, to store the HTML on the server. On your page that you
    buffer out to the client have a link to the file it created. You can use
    the Session ID to name the file to make sure it is Unique. Now comes the
    act of removing the file from the server when the Client leaves. With IIS
    the default time for a session variable to time out is 20 mins, you can Bypass
    this Explicitly by setting its session.timeout at page level, also if you
    wish to kill the session you could call the .abandit method or change the
    IIS time out on the server. Now when the Session Times out or gets abandoned
    the Session_OnEnd is called. Using the Global.asa file code the Session_OnEnd()
    Sub and deallocate the FSO.

    I Hope this was a help sorry for a brief explanation on one way to do this.
    Also know that using the Session Object requires the Client to have Cookies
    turned on.
    <CFML OUTPUT>
    -Rich
    :P
    </CFML OUTPUT>



    "ILA SINGH" <isingh@businessedge.com> wrote:
    >
    >Hi!
    >Could you please help us out with this...
    >How can we save a dynamically generated report,viewed in a browser, as an
    >"HTML file" on to our server(Win NT).
    >
    >We are working with Coldfusion which is same as ASP as far as logic comes.
    >
    >We want to code it and not use 'save as' from the browser.
    >Thankyou
    >Have a nice day.
    >Ila Singh
    >



  3. #3
    Avron Polakow Guest

    Re: Saving a file as HTML

    You can read the html from javascript and send it back
    - within the TEXT of a <FORM>
    - or in the the QueryString (if it is not too long).

    NOTE: You should replace all the gremlins (carriage returns, spaces and tabs
    etc) before sending
    to the server, and then undo them back to their original on the server.

    Check the attachment for an example to see how to read the HTML in IE.
    (The attributes buttons is irrelevant).

    In NS you need to use java. Much more complicated!

    ILA SINGH wrote:

    > Hi!
    > Could you please help us out with this...
    > How can we save a dynamically generated report,viewed in a browser, as an
    > "HTML file" on to our server(Win NT).
    >
    > We are working with Coldfusion which is same as ASP as far as logic comes.
    >
    > We want to code it and not use 'save as' from the browser.
    > Thankyou
    > Have a nice day.
    > Ila Singh



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center