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>
<div class="topbar">
<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 class="content">
@@ -259,12 +259,17 @@ fileInput.addEventListener('change', async function() {
renderTable();
try {
var zipResp = await fetch(UNZIP_URL, {
method: 'POST',
body: f,
headers: {'Content-Type': 'application/zip'}
var zipResp = await new Promise(function(resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.open('POST', UNZIP_URL);
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');
// Убрать строку ZIP из таблицы