Fork me on GitHub
#liberator
<
2016-10-04
>
danielgrosse11:10:44

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.

ordnungswidrig12:10:18

@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.

ordnungswidrig12:10:17

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.

danielgrosse12:10:31

Thank you for the answer.

ordnungswidrig13:10:46

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