I would like to take an image from my database and move it to a public URL where another application is going to grab it.
Now, I think that the way to do this would be to use the http plugin and then create a POST. However, I’m unsure how to specify a database element with setBodyContent, and I’m also unsure whether I can just send an image “as is” that way, or whether it needs to be manipulated some way in order to accomplish the POST and still have the image be useful on the other end. I’m also waiting to hear back from the folks with the other application to see if the image needs to be encapsulated in some way since there is some other data that needs to go along so that they know where to put the image.
You need to create a web service for this, not use the http plugin: the http plugin acts as a client, in your case you want to act as a server…
The easiest way will be to use the Velocity plugin, where you will be able to define a simple ByteResponse giving it the bytes of the image you want to publish (plugins.Velocity.createByteResponse() or plugins.Velocity.createFileResponse()).