-
-
Save parzibyte/2d21a5ae8c1480d44d4367fcaf4b6a9d 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