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 | |
/** | |
Envío de múltiples archivos y datos | |
a PHP desde AngularJS usando FormData y $http | |
@author parzibyte | |
parzibyte.me/blog | |
*/ | |
// Los archivos en $_FILES y lo demás en $_POST | |
$nombre = $_POST["nombre"]; | |
// Aquí podemos hacer lo que sea con $nombre | |
foreach ($_FILES as $archivo) { | |
move_uploaded_file($archivo["tmp_name"], $archivo["name"]); | |
} | |
# La respuesta que recibe $http.post en el then de la promesa | |
echo true; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment