Search everywhere only in this topic. Advanced Search. Classic List Threaded. Michael Mallete. Proper way to stream file from controller.
|Published (Last):||19 June 2016|
|PDF File Size:||7.29 Mb|
|ePub File Size:||3.8 Mb|
|Price:||Free* [*Free Regsitration Required]|
Search everywhere only in this topic. Advanced Search. Classic List Threaded. Michael Mallete. Proper way to stream file from controller. Hi all, I have a controller which would stream file as response.
Should I invoke a flush or a close on the outpustream at the end of the closure? Lauk Daniel. Re: Proper way to stream file from controller. Are you facing any problems with that? My code is only a little different, in that I don't set the "Content-disposition" header and flush afterwards.
I have found it beneficial to use some of the new 'Groovy' methods on the File class in particular the File. If the byte arrays in your examples are large, or if the 'download' action is called frequently, you could run into problems.
If that's the case, copy from stream to stream. Will give this a shot. In reply to this post by Lauk Daniel. What happens is that whenever I access it, Firefox fires up Totem plugin which streams the file from the controller. I will then get an IllegalStateException: Stream whenever I close the window before the full audio file gets to play.
Other than that, so far things are ok. Free forum by Nabble. Edit this page.
Upgrading a Grails 2 application to Grails 3
Proper way to stream file from controller
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together. Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Already on GitHub? Sign in to your account. IllegalStateException: getOutputStream has already been called for this response at org.
Subscribe to RSS