In this situation, I created a zip file containing the search result files, and try to send it to the user. Here is a piece of code I'm trying to use right now.
File[] zippable = new File[files.size()];
File resultFile = ZipCreator.zip(files.toArray(zippable), results);
InputStream result = new FileInputStream(resultFile);
IOUtils.copy(result, response.getOutputStream());
However, this does not currently work. Instead of returning the zip file I created, it returns an html file. If I manually change the file extension after this, I see that the contents of the file are still the result of the search I need. Therefore, the problem is returning the correct answer extension.
Does anyone have any tips for this situation?
source
share