Hi @MV_10441462
depends how do you start your function.
usually you get request and get the outputstream from it and flush (send) the data to the client as @avillanueva's example shows you. .
here is short snip with a zipStream but you need to learn how to add files to the zip stream
HTTPResponse resp; // you need to get respons from commandBean or whereever HttpServletResponse response = nmCommandBean.getResponse();
ByteArrayOutputStream zipOut = new ByteArrayOutputStream();
CheckedOutputStream checksum = new CheckedOutputStream(zipOut, new Adler32());
ZipOutputStream zipOutputStream = new ZipOutputStream(new BufferedOutputStream(checksum));
InputStream contentStream = ContentServerHelper.service.findContentStream(appDatatToZip);
// definice filename s cestou v zip
String fileZipEntry = appDatatToZip.getFileName();
addStreamToZip(fileZipEntry, zipOutputStream, contentStream); // annother sub method where the content is writen to zip
zipOutputStream.close();
OutputStream output = resp.getOutputStream();
resp.setHeader("Content-disposition", "attachment; filename=zipDownloadFile.zip");
resp.setHeader("Content-Type", "application/zip");
output.write(zipOut.toByteArray()); // zip stream written to the respons outputStream
output.flush();
output.close();
PetrH