I have this code below, where it decodes a string into an image and displays it in the browser, but I can not save the decoded image with a random name and save it to disk.
$string = 'iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAgAElEQVR4nNR9d1gU1/f3mdnOLlvobelIEVEEsWPDgokaC7bYYos ........'
$decoded = base64_decode($string);
header("Content-Type: image/png");
echo $decoded;
?>
I have tried to use the Fopen function without success. Any tips?
Thank you.