I’ve just learnt how to use the Struts 2 file uploader to upload a file. After it has been uploaded it saves the file as a .tmp file.
I would like to take this .tmp file and store it in the database then retrieve it on server-side and then display it as an image (that’s what it is) on the client-side.
To do this I use a byte[] array right?
How do I do this?
EDIT 1:
I’m looking for the java server-side code required to convert the tmp file to an image as well as the struts/client-side code to display the image – i.e. name="object.image"
Try to use these types The BLOB and TEXT Types
EDIT
BUT Dave Newton is right!!!
simple code, just change
fileinputstreamto yourinputstreamEDIT 1
If you are looking code that convert tmp to jpeg or other picture format, just read tmp and save to jpeg or other picture format (I think you are receiving picture format from client side but jsut with tmp extension if not, I do not think that this task is real!