Save file as - dialog box with dynamic data
I know that this question is quite common, but its specifics are stumping me.
I have an "export" button which I want to take a load 开发者_开发知识库of data generated, create a CSV file, then pop up a Save File As dialog box, to save that file on their local machine.
The name of this file is dynamic, also.
I know how to make the CSV file, but how do I then pop up a box on the client side to let the user download it?
I am using JSP with Struts
All you need to do is to send a response containing your generated csv with a header:
Content-Disposition: attachment; filename=your_file.csv
精彩评论