JAVA Download Multiple Files Servlet Response -
i have servlet , writing stuff in file. need 1 file 1 data.
i doing:
resp.setcontenttype("application/x-download"); resp.setheader("content-disposition", "attachment;filename="+ urlencoder.encode(filename, "utf-8")); /* stuff */ resp.getwriter().println(data); but have "for" loop.
so @ end of each loop, download 1 different file:
for (int cpt = 0; cpt < listdata.size(); cpt ++){ resp.setcontenttype("application/x-download"); resp.setheader("content-disposition", "attachment;filename="+ urlencoder.encode(filename, "utf-8")); resp.getwriter().println(listdata.get(i)); /* download file , i++ */ } thanks help!
java file servlets
No comments:
Post a Comment