in message :
: : > "Mark Schupp" wrote in message
: : > : Response.ContentType = "text/comma-separated-values"
: > : Response.AddHeader "Content-Disposition","attachment;
: > filename=extract.csv"
: > :
: > : For i = 1 to 10
: > :
: > : Next
: > : Response.Write CSVString( "row" & CStr(i)) & "," &
CSVString("column
: > 2")
: > : & vbCrLf
: > : Response.end
: > :
: > : Function CSVString( ByVal strIn )
: > : If IsNull( strIn ) Then strIn = ""
: > : CSVString = """" & Replace(strIn, """", "'") & """"
: > : CSVString = Replace(CSVString, vbCrLf, "<cr>")
: > : End Function
: >
: > In this example, shouldn't the response.write goes inside the for...next
: > loop?
: > And, how do you keep from getting the Action cancelled page?
:
: It is an oversimplified example probably modified in haste. I think just
: about everybody has been guilty of that at least once in their life. Yes,
: the Response.Write should be between the For and Next. My query was
: interpreted correctly though - how to push a file to a browser. The key
bits
: are the Response.ContentType and Response.AddHeader methods (to which I
add
: Response.Clear at the beginning and Response.Flush just before the
: Response.End). What happens between the Response.AddHeader and the
: Response.Flush, Response.End is really of no consequence.
It is to me. I was asking for knowledge, not to challenge. I wasn't aware
I could send content as a file without first having a file.
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center -
http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation -
http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library -
http://msdn.microsoft.com/library/default.asp