v1.0.127: ZIP — XHR.send(file) instead of fetch, same pattern as working uploads

This commit is contained in:
2026-06-23 08:45:59 +04:00
parent 2f066e74e0
commit 086c46f8e6
+11 -6
View File
@@ -75,7 +75,7 @@
<body> <body>
<div class="topbar"> <div class="topbar">
<img src="/nubes-logo.svg" alt="Nubes"> <img src="/nubes-logo.svg" alt="Nubes">
<span class="title">Сверка договоров — LLM AI-driven Event Sourcing <span style="font-weight:400;color:var(--muted);font-size:12px;">v1.0.126 — Lucee</span></span> <span class="title">Сверка договоров — LLM AI-driven Event Sourcing <span style="font-weight:400;color:var(--muted);font-size:12px;">v1.0.127 — Lucee</span></span>
</div> </div>
<div class="content"> <div class="content">
@@ -259,12 +259,17 @@ fileInput.addEventListener('change', async function() {
renderTable(); renderTable();
try { try {
var zipResp = await fetch(UNZIP_URL, { var zipResp = await new Promise(function(resolve, reject) {
method: 'POST', var xhr = new XMLHttpRequest();
body: f, xhr.open('POST', UNZIP_URL);
headers: {'Content-Type': 'application/zip'} xhr.responseType = 'json';
xhr.onload = function() { resolve(xhr.response); };
xhr.onerror = function() { reject(new Error('Сеть')); };
xhr.ontimeout = function() { reject(new Error('Таймаут')); };
xhr.timeout = 60000;
xhr.send(f);
}); });
var zipData = await zipResp.json(); var zipData = zipResp;
if (!zipData.ok || !zipData.files) throw new Error('unzip failed'); if (!zipData.ok || !zipData.files) throw new Error('unzip failed');
// Убрать строку ZIP из таблицы // Убрать строку ZIP из таблицы