Hi,
I have a piece of code please check it.
I tried this and successful in receiving file.
My file type is ".txt".
//----------------------------------------
//Write A servlet class extending HttpServerlet
inside doGet method write this.
resp.setContentType("application/csv");
resp.setHeader("Content-disposition", "attachment; filename=" + "Report.txt");
ServletOutputStream outputStream = resp.getOutputStream();
for (int i = 0; i < buff.length(); ++i) {
outputStream.write(buff.charAt(i));
}
outputStream.close();
At client side:---
String baseURL = GWT.getModuleBaseURL();
String url = baseURL + "/VersionDetailServlet.do";
Window.open(url, "", "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=no,toolbar=true, width=" + Window.getClientWidth() + ",height=" + Window.getClientHeight());
It will prompt a dialog to save file.