public function setCarpetadestino($param) { if (!$param) { $this->error = 2.1; return; } else { $permitidos = "ABCDEFGHIJKLMNÑOPQRSTUVWXYZabcdefghijklmnñopqrstuvwxyz ÁÉÍÓÚáéíóú123456789"; for ($i = 0; $i < strlen($param); $i++) { if (strpos($permitidos, substr($param, $i, 1)) === false) { $this->error = 2.2; return; } } } $this->carpetadestino = Ruta::getRutaPadre(Ruta::getRutaServidor()) . Configuracion::CARPETA . $param; //crear carpeta si no existe if (!file_exists($this->carpetadestino)) { mkdir($this->carpetadestino, 0777, true); } $param = "/"; $this->carpetadestino .= $param; }