Re: Inserting .png file into bytea column

Поиск
Список
Период
Сортировка
От Dorian Machado
Тема Re: Inserting .png file into bytea column
Дата
Msg-id CAFLCYiroy=BjX854JLH+NQQfGG0KkST6=hqCY0D2huj1ncM2DQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Inserting .png file into bytea column  (Craig James <cjames@emolecules.com>)
Список pgsql-admin
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="data:image/gif;base64,' . base64_decode($data) . '" />';

В списке pgsql-admin по дате отправления:

Предыдущее
От: "Ferrell, Denise D CTR NSWCDD, H11"
Дата:
Сообщение: Re: [Non-DoD Source] Re: Inserting .png file into bytea column
Следующее
От: Thomas Kellerer
Дата:
Сообщение: Re: Inserting .png file into bytea column