include_once $PFN_paths['include'] . 'class_inc.php'; $PFN_arquivos = new PFN_Arquivos($PFN_conf); $PFN_inc = new PFN_INC($PFN_conf); $PFN_inc->arquivos($PFN_arquivos); $PFN_inc->carga_datos($arquivo); $PFN_accions->arquivos($PFN_arquivos); if ($PFN_vars->get('zlib') && $PFN_conf->g('zlib') == true && $PFN_conf->g('permisos', 'comprimir')) { @set_time_limit($PFN_conf->g('tempo_maximo')); @ini_set('memory_limit', $PFN_conf->g('memoria_maxima')); include_once $PFN_paths['include'] . 'class_easyzip.php'; $EasyZIP->comeza($arquivo); $contido =& $EasyZIP->zipFile(); $tamano = strlen($contido); $estado = $PFN_accions->log_ancho_banda($tamano); if ($estado === true) { $PFN_inc->mais_datos('descargado', $PFN_inc->valor('descargado') + 1); $PFN_inc->crea_inc($arquivo . ($tipo == 'dir' ? '/' : ''), $tipo); header('Pragma: private'); header('Expires: 0'); header('Cache-control: private, must-revalidate'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Content-Type: application/force-download; charset=' . $PFN_conf->g('charset')); header('Content-Transfer-Encoding: binary'); header('Content-Disposition: attachment; filename="' . str_replace(array(' ', '"'), '_', $cal . '.zip') . '"'); header('Content-Length: ' . $tamano); echo $contido; exit; } elseif ($estado === -1) { $erro = true; $estado_accion = $PFN_conf->t(array('estado.descargar', 3), $PFN_paths['info']); } else {
$peso_este = PFN_espacio_disco($donde . '/' . $cal, true); if ($peso_este + $PFN_conf->g('raiz', 'peso_actual') > $PFN_conf->g('raiz', 'peso_maximo')) { @unlink($donde . '/' . $cal); $estado_accion = $PFN_conf->t('estado.subir_url', 7) . '<br />'; $erro = true; } } $ancho_banda = $PFN_accions->log_ancho_banda($peso_este); if (!$ancho_banda) { @unlink($donde . '/' . $cal); $estado_accion = $PFN_conf->t('estado.subir_url', 9) . '<br />'; $erro = true; } if (!$erro && $PFN_conf->g('inc', 'estado')) { $PFN_inc->arquivos($PFN_arquivos); $PFN_inc->mais_datos('usuario', $PFN_conf->g('usuario', 'usuario')); $arq_inc = $PFN_inc->crea_inc($donde . '/' . $cal, 'url'); } if (!$erro && $PFN_conf->g('inc', 'indexar')) { include_once $PFN_paths['include'] . 'class_indexador.php'; $PFN_indexador = new PFN_Indexador($PFN_conf); $PFN_indexador->alta_modificacion("{$dir}/", $cal, $arq_inc); } if (!$erro && $PFN_conf->g('raiz', 'peso_maximo') > 0) { $peso_este += $PFN_conf->g('raiz', 'peso_actual'); if ($PFN_conf->g('inc', 'estado')) { $peso_este += PFN_espacio_disco($arq_inc, true); } $PFN_conf->p($peso_este, 'raiz', 'peso_actual'); $PFN_usuarios->accion('peso', $peso_este, $PFN_conf->g('raiz', 'id')); }