html display images without intermediate file
[email protected] Wed, 9 Apr 2014 18:01:16 +0200
| Newsgroups | gmane.comp.db.postgresql.php |
|---|---|
| Message-ID | <[email protected]> |
--Apple-Mail=_AA533BDD-DB91-4559-8D44-EA6159F1D7D0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=us-ascii
Bonjour
code working :
$link = pg_Connect("host=localhost dbname=... user=... password='...'");
$res = pg_query($link, "select miniature from photo ");
$numrows = pg_numrows($res);
for($ri = 0; $ri < $numrows; $ri++) {
$row = pg_fetch_array($res, $ri);
$img = pg_unescape_bytea($row['miniature']);
$fln = "toto".$ri.".jpeg";
file_put_contents($fln, $img);
echo "<img src='".$fln."'/>";
}
How to do without the intermediate file $fln ?
Merci
--Apple-Mail=_AA533BDD-DB91-4559-8D44-EA6159F1D7D0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=us-ascii
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html =
charset=3Dus-ascii"><meta http-equiv=3D"Content-Type" content=3D"text/html=
charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br>
<div class=3D"inbox" style=3D"margin: 0px; padding: 0px 0px 1px; =
list-style: none; min-height: 1px; color: rgb(51, 51, 51); font-family: =
Verdana, Arial, Helvetica, sans-serif; font-size: 11px;"><div =
class=3D"postbody" style=3D"margin: 0px; padding: 0px; list-style: =
none;"><div class=3D"postright" style=3D"margin: 0px; padding: 6px; =
list-style: none; border-left-width: 18em; border-left-style: solid; =
background-color: rgb(222, 223, 223); border-left-color: rgb(241, 241, =
241); position: static; z-index: auto;"><div class=3D"postmsg" =
style=3D"margin: 0px; padding: 0px; list-style: none; overflow: hidden; =
width: 806px;"><div style=3D"margin: 0px; padding: 0px; list-style: =
none; line-height: 1.4;">Bonjour</div><div style=3D"margin: 0px; =
padding: 0px; list-style: none; line-height: 1.4;">code working =
:<br>$link =3D pg_Connect("host=3Dlocalhost dbname=3D... user=3D... =
password=3D'...'");<br>$res =3D pg_query($link, "select miniature =
from photo ");<br>$numrows =3D pg_numrows($res);<br>for($ri =3D 0; $ri =
< $numrows; $ri++) {<br>$row =3D pg_fetch_array($res, $ri);<br>$img =
=3D pg_unescape_bytea($row['miniature']);<br>$fln =3D =
"toto".$ri.".jpeg";<br>file_put_contents($fln, $img);<br>echo "<img =
src=3D'".$fln."'/>";<br>}</div><div style=3D"margin: 0px; padding: =
0px; list-style: none; line-height: 1.4;">How to do without the =
intermediate file $fln ?</div><div style=3D"margin: 0px; padding: =
0px; list-style: none; line-height: =
1.4;">Merci</div></div></div></div></div><div class=3D"inbox" =
style=3D"margin: 0px; padding: 0px 0px 1px; list-style: none; =
min-height: 1px; color: rgb(51, 51, 51); font-family: Verdana, Arial, =
Helvetica, sans-serif; font-size: 11px;"><div class=3D"postfoot clearb" =
style=3D"margin: 0px; padding: 0px; list-style: none; clear: both;"><div =
class=3D"postfootleft" style=3D"margin: -1px 0px 0px; padding: 1px 0px =
0px; list-style: none; float: left; width: 18em; overflow: hidden; =
position: relative; background-color: rgb(241, 241, =
241);"></div></div></div></body></html>=
--Apple-Mail=_AA533BDD-DB91-4559-8D44-EA6159F1D7D0--