Date:  07/26/2004 01:11:39 PM Msg ID:  002149
From:  Ramon Thread:  002143
Subject:  Re: FWX to HTML
thank you very much for your help and it works fine. i just wonder before about "postdata" function (i thought it's new from foxweb). thanks again for the help!
Sent by FoxWeb Support on 07/23/2004 08:27:41 PM:
First of all, I just realized that I made a mistake in the code I provided in my previous answer (I have already corrected it):  All output that has still not been sent to the browser sits in Response.OutputBuffer -- not Request.PostData.  Also, a better way to empty the output buffer is to use Response.Clear (also incorporated in my corrected code). Sorry if this caused you any trouble.
 
It really makes no difference whether the page is called via Response.Redirect, or via a regular link.  The Response.Redirect method sends a response to the browser asking it to request the page in question, so to FoxWeb the result is identical.
 
The Response.Buffer property is equivalent to the Buffer Output configuration setting, but only affects the current request.  The Response.OutputBuffer contains any data that is waiting to be sent to the browser.  It gets sent by one of the following triggers:
  • If buffering is off, it gets sent immediatelly.
  • If buffering is on, it gets sent after calls to Response.Flush.
  • If none of the above is true, the output gets sent after script execution is completed.
What this means is that you can turn buffering on, call an FWX file and retrieve its output from Response.OutputBuffer, so that you can send it by email.  If you don't want to the user to also receive the content in her browser, you can call Response.Clear and then send an alternate response.

FoxWeb Support Team
support@foxweb.com email

Sent by Ramon on 07/23/2004 01:38:31 PM:
first, i'm using response.redirect to call somefile.fwx. 2nd, when buffer = .f., does it create output file like somefile.html? and where can i access it? is it sitting on request.postdata?
 
Sent by FoxWeb Support on 07/23/2004 12:55:48 PM:
The property Response.OutputBuffer contains the information that would be sent to the browser.  Of course you can't access this information from within the same FWX file, but you can have a wrapper FWX file as follows:
 
<%
* You will first need to disable buffering
Response.Buffer = .F.
* Call the fwx file that creates the desired HTML output
Server.Execute SomeFile.fwx
* Read the output and email it out
MySendMail(Response.OutputBuffer)  && you will have to provide this function
* If you want you empty the buffer and send different output to the user
Response.Clear
Response.Write('The requested information was sent via email')
%>
 

FoxWeb Support Team
support@foxweb.com email

Sent by Ramon on 07/23/2004 11:10:44 AM:
can anyone help me how to save the processed .fwx to html file?
the idea is, i want to email that output .html to someone.