Re: Inserting .png file into bytea column

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello

Try to use a TEXT column for the flags in the table.

You musto to encode the image has base64 and then to retrive the image to the web you must to decode de content of the field.

It is a simple a easy way to store and retrive images from databases

For example

For HTML
<img alt="Embedded Image" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAABBCAIAAAABlV4SAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAABJFSURBVHja1F . ." />

For PHP
echo '<img src=""> . base64_decode($data) . '" />';

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux