I would like to transform a base64 image obtained from an input. But in doing so I print "ZGVzY2FyZ2ExLmpwZw ==" or something similar with each image I try. How do I make it so that I really get the image in base 64?
HTML:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<form role="form" action="imagen.php" method="post" name="productoform">
<input type="file" name="imagen" required class="form-control">
<input type="submit" name="sub" value="Base64">
</form>
</body>
</html>
PHP:
<?php
$imagen = utf8_decode($_POST['imagen']);
$imdata = base64_encode($imagen);
echo $imdata;
?>