开发者

Save file as - dialog box with dynamic data

开发者 https://www.devze.com 2023-01-03 21:00 出处:网络
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 u

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
0

精彩评论

暂无评论...
验证码 换一张
取 消