$val) { foreach($val as $k => $v) { $imagenes[$k][$key] = $v; } } foreach($imagenes as $v) { $tempFile = $v['tmp_name']; $targetFile = rtrim($targetPath,'/') . '/' . $v['name']; // Validate the file type $fileTypes = array('jpg','jpeg','gif','png'); // File extensions $fileParts = pathinfo($v['name']); if (!file_exists($targetPath)) { mkdir($targetPath); chmod($targetPath, 0755); } if (in_array($fileParts['extension'],$fileTypes)) { move_uploaded_file($tempFile,$targetFile); //echo str_replace($_SERVER['DOCUMENT_ROOT'],'',$targetFile); } else { echo 'Tipo de archivo no vĂ¡lido.'; } } exit; } ?> CEIP Guadalhorce - Tablón de Anuncios