I do this all the time in CF and ASP, but I don't know the equivalent JSP code.
You can send out these headers:
"Content-Type: application/unknown"
"Content-Disposition: filename=myfile.csv"
"Content-Transfer-Encoding: binary"
and the file generated by the page should be downloadable as a CSV.
tom
----- Original Message -----
From: "Bert Dawson" <[EMAIL PROTECTED]>
To: "JRun-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, April 25, 2001 1:18 PM
Subject: serving up a csv...
> I've got a jsp page that runs a report and has to serve the results in csv
> format, in which case it should be opened with excel (or whatever).
>
> I've got it to prompt me to "save file from current location/open it" by
> using the page directive contentType="unknown", but the file still has a jsp
> extension, so it opens in Jrun Studio - not ideal...
>
> Any ideas how i get it to open/save myfile.csv rather than myreport.jsp?
>
> Cheers
> Bert
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists