case 'sxw':
        $content_type = 'application/sxw';
        break;
    case 'dia':
        $content_type = 'application/dia';
        break;
    case "sql":
        $content_type = 'application/octet-stream';
        break;
}
if ($type == "sbk") {
    $file = PATH_BACKUPS . $file . "." . $type;
} else {
    if (isset($tabla)) {
        $xSys = new cSystemTask();
        $file = $xSys->setBackupTable($tabla);
        $content_type = 'application/octet-stream';
        $type = "sql.gz";
        $date = date("Ymd");
        $download = "{$tabla}-{$date}";
    } else {
        $file = PATH_TMP . $file . "." . $type;
    }
}
if ($type != 'html') {
    header("Content-type: {$content_type}");
    //ISO-8859-1
    header("Content-Disposition: attachment; filename=\"{$download}.{$type}\"; ");
    //header("Content-Disposition: ");
}
readfile($file);