I have stored a pdf file in database as a blob data type. I am getting it through query. I have a search result page where
i want to provide a link to view the image of this pdf data. Please tell me how to convert the blob data to the image content
in servlet. and set it in response.
Sorry i dont know in which section my question will fit. Please move to the proper section if so.
Thanks in advance.
Regards, Vijay Jamadade.
( Nothing is Impossible.)
posted 7 years ago
Just get an InputStream of it using ResultSet#getBinaryStream() and then write it to the OutputStream of the HttpServletResponse.
Don´t forget to set the important response headers accordingly. At least the content-type, content-disposition and content-length.