I have saved a picture into database,such as oracle blob.I want to get this picture from database and show it in fckeditor.I can get this picture from database,and show it in a jsp,like follows:
But I don't know how to show it in fckeditor.How to solve above question?
Thanks in advance!
Blob photo = zp.getPic(); InputStream in = photo.getBinaryStream(); OutputStream out = response.getOutputStream(); byte[] buf = new byte[1024]; int len; while ((len = in.read(buf)) != -1) ...{ out.write(buf, 0, len); } in.close(); out.close();
But I don't know how to show it in fckeditor.How to solve above question?
Thanks in advance!
Re: How to show binary picture in fckeditor?
Pipe the IS to the OS of the servlet response. Prior piping set content/mime-type to image/png or jpeg or whatever it is.
Three seconds of google would have spared you the minutes to write this post: http://www.exampledepot.com/egs/javax.s ... Image.html
With Commons IO the code gets even smaller.