View Single Post

  #8 (permalink)  
Old 12-04-2006
Zbigniew Lisiecki
 
Posts: n/a
Default Re: picture sent in http with base64

Michael Fesser wrote:

> .oO(Zbigniew Lisiecki)
>
>>to provide visual confirmation for
>>http://beztajemnic.evot.org/index.php?s=1
>>my server is sending data:image/png;base64 in the http protocoll.
>>This allows to omit writting picture data on the disk,
>>actually this part of the disk is read only.
>>
>>With my KDE/konqueror and Firefox under Linux I can see the
>>correct picture, but some clients don't see it.
>>How could I correct this error ?

>
> IE doesn't support data URLs.


It means you don't see the picture, do you ?
What is the correct solution on the read-only server fs then ?

The way i do now is:

function gen_rand_img () {
...
ob_start (NULL, 4096);
imagepng($img);
imagedestroy($img);
return (base64_encode(ob_get_clean()));
}

$head="
<!doctype html public \"-//w3c//dtd html 4.0 transitional//EN\">
<html>
<head>
<title>...</title>
<meta http-equiv=\"Content-Type\" content=\"text/html;
charset=iso-8859-2\"
....";

echo $head;

header("Cache-Control: no-store, no-cache, must-revalidate"); //http/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0

....

echo "
echo "<img src=\"data:image/png;base64,".gen_rand_img()."\"
name=\"vconf.png\">";


z
--
http://zbyszek.evot.org
Reply With Quote