$sk = SP\Request::analyze('sk', false); if (!$sk || !SessionUtil::checkSessionKey($sk)) { die(_('CONSULTA INVÁLIDA')); } if (!SP\Util::fileIsEnabled()) { exit(_('Gestión de archivos deshabilitada')); } $action = SP\Request::analyze('action'); $accountId = SP\Request::analyze('accountId', 0); $fileId = SP\Request::analyze('fileId', 0); $log = new \SP\Log(); if ($action == 'upload') { if (!is_array($_FILES["inFile"]) || $accountId === 0) { \SP\Response::printJSON(_('CONSULTA INVÁLIDA')); } $log->setAction(_('Subir Archivo')); $allowedExts = strtoupper(SP\Config::getValue('files_allowed_exts')); $allowedSize = SP\Config::getValue('files_allowed_size'); if ($allowedExts) { // Extensiones aceptadas $extsOk = explode(",", $allowedExts); } else { $log->addDescription(_('No hay extensiones permitidas')); $log->writeLog(); \SP\Response::printJSON($log->getDescription()); } if (is_array($_FILES) && $_FILES['inFile']['name']) { // Comprobamos la extensión del archivo $fileData['extension'] = strtoupper(pathinfo($_FILES['inFile']['name'], PATHINFO_EXTENSION)); if (!in_array($fileData['extension'], $extsOk)) { $log->addDescription(_('Tipo de archivo no soportado') . " '" . $fileData['extension'] . "' ");