In your domain class, define
class Something{
byte[] image
}
in your controller, call
def image= {
def something = Something.get( params.id )
byte[] image = something.image
response.outputStream << image
}
Image gets copied to the database. You can then show it by
<img src="${createLink(controller:'something', action:'image', id: something.id)}"/>
Misleading title. This is not up- but much rather downloading a picture 😉
well, the upload code is generated automagically in your edit views –
nice.
I think you forgot to set content type in your controller.
Thanks,
Mikhail