Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to send ASCII delimited file for a browser to downlo
Message
From
26/01/2001 07:14:25
 
 
To
25/01/2001 15:24:22
General information
Forum:
Internet
Category:
Active Server Page
Miscellaneous
Thread ID:
00468740
Message ID:
00468965
Views:
13
>I'm primarily a VFP developer. For this particular project I had to go the pure ASP/VBS/ADO route. I'm almost finished amnd it's looking good.
>
>One page generates an HTML report using ADO and VBS. After the report is shown, one of the choices the user gets is to download the data in an ASCII delimited file (that was the request, though I might add XML in the future).
>
>I recurse the report page, using the same ADO logic, but instead of Response.Write to create an HTML table, I concatenate the data, delimited with commas into a variable.
>
>Q: What's the syntax to send the variable contents as a download file? Obviously I do not want to Response.Write to the browser.
>
>Q: Is the variable concatenation idea OK? I don't expect the dataset to be too big. Any other (better) choices?
>
>TIA


One way is to output with response.write without any HTML tags. The user can then choose File/Save As to save the file.
You can also output to a temp file on the server and redirect to that file. You'll have to clean up at some point. If the file contains sensitive data, other users could have access to it before you delete the file.
Guy Barrette, MCSD
============
Blog http://weblogs.asp.net/guybarrette
Microsoft Regional Director, Montreal, Canada www.microsoft.com/rd
MVP, ASP.NET http://mvp.support.microsoft.com/
President, Montreal Visual Studio User Group www.guvsm.net
INETA Regional Rep for Quebec www.ineta.org
UniversalThread Magazine Columnist (.NET Books Review Column) www.utmag.com
Tech Chair French Track, DevTeach 2004 & 2005 www.devteach.com
Business Architect, Microsoft Team - Nurun Inc www.nurun.com
XBox Live Gamer Tag: Slomo QC CA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform