$data = $_POST['data'];
//removing the "data:image/png;base64," part
$uri = substr($data,strpos($data,",")+1);
header('Content-type: image/png');
header('Content-Disposition: attachment; filename="wow.png"');
echo base64_decode($uri);
It looks like you're new here. If you want to get involved, click one of these buttons!