Good day, I'm working with Xammp
creating a API
that loads files and I have this code:
$nomarchivo = $_FILES['file']['name'];
$tipoarchivo = $_FILES['file']['type'];
$tamano = $_FILES['file']['size'];
$uploadsdir = "*/files/";
if (($tipoarchivo === "application/pdf") && ($tamano < 1000000)) {
move_uploaded_file($_FILES['file']['tmp_name'], $uploadsdir.$nomarchivo);
} else {
echo "Solo se permiten archivos pdf y temaño menor a 125kb";
}
but gives these errors:
Warning: move_uploaded_file (* / files / Test.pdf): failed to open stream: No error in C: \ xampp \ htdocs \ tests \ api \ uploadfile.php on line 12
Warning: move_uploaded_file (): Unable to move 'C: \ xampp \ tmp \ phpD852.tmp' to '* / files / Test.pdf' in C: \ xampp \ htdocs \ tests \ api \ uploadfile.php on line 12
Try with% full% co to avoid the error but it does not work. What else can it be?