I am trying to write a dynamic png image to disk on a shared freeBSD server running Apache.
umask();
@ImagePNG($image,"file.png");
I am guessing I need the umask() to change the file permissions. I have tried 0777 and 077 but still cant write.
Another way to the same end would involve
ImagePNG($image)
which writes to the screen from memory but this lies within a function in an include and I am not able to pass it as a variable and redisplay it..
ob_start();
ImagePNG($image);
$image_data = ob_get_contents();
ob_end_clean();
return $image_data;
How do I redisplay it.
Tried these!!
echo "<div class='box'><img src='$image_data'></div>";
or echo “$image_data”;
Thanks
James