Serving Files Through Partial Download Controllers

I need to serve files through grails, only users with permission have access, so I can not serve them with a static reference to the container. The system can seamlessly transfer binary files to the client, but now (for bandwidth problems on the client) I need to implement segmented or partial downloads in the controllers.

Is there a plugin or a proven solution to this problem? Perhaps this is some kind of tomcat / apache plugin to restrict access to files with certain rules or temporary tickets, so that I can delegate the problem of “download loading” or “segmented loading” in a container.

I also need to record and save statistics when loading users. I need good performance, so I think that doing this in the controller is not very good.

Sorry bad english.

+3
source share
1 answer

There is a plugin for apache - https://tn123.org/mod_xsendfile/ No matter what you use for apache in this case. Using this plugin, you will respond with a special header X-SENDFILEindicating the path to the file for maintenance, and Apache will take care of the actual download of the file for the current request.

Nginx, X-Accel-Redirect, . http://wiki.nginx.org/XSendfile

0

Source: https://habr.com/ru/post/1774695/


All Articles