<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>how to display image from DB table (blob format)</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=13337308" />
  <subtitle>how to display image from DB table (blob format)</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=13337308</id>
  <updated>2026-04-04T09:34:01Z</updated>
  <dc:date>2026-04-04T09:34:01Z</dc:date>
  <entry>
    <title>RE: how to display image from DB table (blob format)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112753277" />
    <author>
      <name>Mahammad Ashik A</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112753277</id>
    <updated>2019-03-14T12:24:04Z</updated>
    <published>2019-03-14T12:24:04Z</published>
    <summary type="html">Hi,&lt;br /&gt;&lt;br /&gt;I resolved this issues by below code.&lt;br /&gt;&lt;br /&gt;&amp;lt;%&lt;br /&gt;&lt;br /&gt;Blob blob= &amp;lt;fetch from DB&amp;gt;&lt;br /&gt;&lt;br /&gt;int myblobLength = (int) blob.length();  &lt;br /&gt;byte[] myblobAsBytes = blob.getBytes(1, myblobLength);&lt;br /&gt;String qrCodeDisplay = DatatypeConverter.printBase64Binary(myblobAsBytes); &lt;br /&gt;​​​​​​​&lt;br /&gt;%&amp;gt;&lt;br /&gt;  &lt;br /&gt;&amp;lt;div class=&amp;#34;container text-center&amp;#34;&amp;gt;&lt;br /&gt;    &amp;lt;img  class=&amp;#34;img-responsive&amp;#34; src=&amp;#34;data:image/jpg;base64, &amp;lt;%=qrCodeDisplay%&amp;gt;&amp;#34;/&amp;gt;                            &lt;br /&gt;  &lt;br /&gt;&amp;lt;/div&amp;gt;</summary>
    <dc:creator>Mahammad Ashik A</dc:creator>
    <dc:date>2019-03-14T12:24:04Z</dc:date>
  </entry>
  <entry>
    <title>RE: how to display image from DB table (blob format)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112752703" />
    <author>
      <name>Mahammad Ashik A</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112752703</id>
    <updated>2019-03-14T12:21:47Z</updated>
    <published>2019-03-14T12:21:47Z</published>
    <summary type="html">Hi  &lt;span style="color: inherit"&gt;&lt;span style="font-family: inherit"&gt;&lt;span style="font-size: 14px;"&gt;Olaf Kock ,&lt;br /&gt;&lt;br /&gt;​​​​​​​Thanks for your support&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;</summary>
    <dc:creator>Mahammad Ashik A</dc:creator>
    <dc:date>2019-03-14T12:21:47Z</dc:date>
  </entry>
  <entry>
    <title>RE: how to display image from DB table (blob format)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112683028" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112683028</id>
    <updated>2019-03-12T07:07:18Z</updated>
    <published>2019-03-12T07:07:18Z</published>
    <summary type="html">&lt;blockquote&gt;Mahammad Ashik A&lt;br /&gt;&lt;br /&gt;I am storing image as a blob in db. Now i need to disply that blob image in jsp.&lt;br /&gt;&lt;/blockquote&gt;I&amp;#39;m assuming that you know how to get the image out of the database, and which image format it is. &lt;br /&gt;&lt;br /&gt;In order to provide a URL for it, I&amp;#39;m assuming that you have a portlet (that contains your JSP). In that portlet, use a &amp;lt;portlet:resourceURL&amp;gt;, parameterize it with (e.g.) the image&amp;#39;s id. In the portlet&amp;#39;s serveResource method, use that id to find the appropriate image, set the content type and stream the image to the browser (resourceResponse.getOutputStream()).</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2019-03-12T07:07:18Z</dc:date>
  </entry>
  <entry>
    <title>RE: how to display image from DB table (blob format)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112682091" />
    <author>
      <name>Mahammad Ashik A</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112682091</id>
    <updated>2019-03-12T06:05:20Z</updated>
    <published>2019-03-12T06:05:20Z</published>
    <summary type="html">Hi,&lt;br /&gt;I am facing same issues.&lt;br /&gt;&lt;br /&gt;I am storing image as a blob in db. Now i need to disply that blob image in jsp.&lt;br /&gt;&lt;br /&gt;How to resolve this.</summary>
    <dc:creator>Mahammad Ashik A</dc:creator>
    <dc:date>2019-03-12T06:05:20Z</dc:date>
  </entry>
  <entry>
    <title>RE: how to display image from DB table (blob format)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=13356782" />
    <author>
      <name>Hitoshi Ozawa</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=13356782</id>
    <updated>2012-04-06T14:28:15Z</updated>
    <published>2012-04-06T14:28:15Z</published>
    <summary type="html">The liferay&amp;#39;s way is to create service.xml and portal-model-hints.xml  and may be ext-spring.xml as well.</summary>
    <dc:creator>Hitoshi Ozawa</dc:creator>
    <dc:date>2012-04-06T14:28:15Z</dc:date>
  </entry>
  <entry>
    <title>how to display image from DB table (blob format)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=13337307" />
    <author>
      <name>akash rathod</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=13337307</id>
    <updated>2012-04-05T11:29:54Z</updated>
    <published>2012-04-05T11:29:54Z</published>
    <summary type="html">hi friends &lt;br /&gt;   i have store my image in mysql table(blob format) .i am using liferay portal 6.0.and i want to display this image on my portlet how to do it?&lt;br /&gt;plz help.</summary>
    <dc:creator>akash rathod</dc:creator>
    <dc:date>2012-04-05T11:29:54Z</dc:date>
  </entry>
</feed>
