I am working on a grails application, it has a file sharing feature. It uploads files onto the server and allows user to download the file from server. I used the following
Instead of loading the file into memory, replace
response.getOutputStream() << new ByteArrayInputStream(file.getBytes())
With:
file.withInputStream { response.outputStream << it }