Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving Data as Text File

Status
Not open for further replies.

cabobound

Programmer
Jul 11, 2007
80
US
Hi all,

Im trying to save my data as a text file but I want the user to be able to use the dialog box to select to open or where to save it. I have the code to simply open the file and loop through through writing the data. I cant find where to get the dialog box to though. Does anyone know where the is a page to tell me how to do this?

K
 
Did you try using Response.AddHeader to specify Content-Disposition as an attachment?
 
I havent found anything for it...all I have found is how to open and write to files.
 
Ok, this code worked to save the data.

response.addHeader "Content-Disposition", "attachement; filename=test.txt"
response.addHeader "Content-Type", "application/x-download"

The one thing it doesnt do is create new rows. If I use the <br> it puts that as a new field. How do I get the new line char for a file using this?

K
 
Turns out that after numorous trials and errors...I can use Response.write vbCrLf and that corrected the problem.

Thanks for the help.

K
 
Thanks for posting your solution for the benefit of others who may search this forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top