liberator

danielgrosse 2016-10-04T11:24:44.000008Z

Hello, could someone give me an example, how I could serve images with liberator? In my case I want to build an string from db entries which results in an image location. This imagefile should be returned as file response.

ordnungswidrig 2016-10-04T12:21:18.000009Z

@danielgrosse they key is that return a status code that redirects, i.e. 303 or 307. In the decision that triggers this status code set the context key :location to the URL you want to redirect to.

ordnungswidrig 2016-10-04T12:22:17.000010Z

For the resource that serves the actual image you need to specify the correct available content-types, e.g. image/png and the handler, say, :handle-ok can return a java.io.File or a byte stream.

danielgrosse 2016-10-04T12:57:31.000011Z

Thank you for the answer.

ordnungswidrig 2016-10-04T13:39:46.000012Z

feel free to ask when you’re stuck somehow. May I ask why you want to do the redirect?