-
-
Save parzibyte/02f6feeded90e28e4ee80aad40a7abd0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$imagenCodificada = $_POST["imagen"]; | |
$imagenCodificadaLimpia = str_replace("data:image/png;base64,", "", $imagenCodificada); | |
$imagenDecodificada = base64_decode($imagenCodificadaLimpia); | |
$nombreImagenGuardada = "imagen_" . uniqid() . ".png"; | |
file_put_contents($nombreImagenGuardada, $imagenDecodificada); | |
echo json_encode($nombreImagenGuardada); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment