From a23ea0f0490809a30bfba7ec3819f6a1bdfe0235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Thu, 18 Jun 2026 21:41:29 +0400 Subject: [PATCH] =?UTF-8?q?v1.0.36:=20=D1=87=D0=B0=D0=BD=D0=BA=D0=B8=208KB?= =?UTF-8?q?=20=E2=80=94=20=D0=BE=D0=B1=D1=85=D0=BE=D0=B4=20H2=20=D0=B1?= =?UTF-8?q?=D0=B0=D0=B3=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api.cfm | 16 ++++++++ chunk.cfm | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ index.cfm | 103 ++++++++++++++++++++++--------------------------- 3 files changed, 175 insertions(+), 57 deletions(-) create mode 100644 chunk.cfm diff --git a/api.cfm b/api.cfm index 05228bd..610ff18 100644 --- a/api.cfm +++ b/api.cfm @@ -85,6 +85,22 @@ + + + CREATE TABLE IF NOT EXISTS upload_chunks ( + id SERIAL PRIMARY KEY, + upload_id TEXT NOT NULL, + chunk_index INTEGER NOT NULL, + total_chunks INTEGER DEFAULT 0, + filename TEXT DEFAULT '', + data TEXT NOT NULL, + contract_id TEXT DEFAULT '', + created_at TIMESTAMPTZ DEFAULT now() + ) + + + + #preserveSingleQuotes(url.sql)# diff --git a/chunk.cfm b/chunk.cfm new file mode 100644 index 0000000..d3818ef --- /dev/null +++ b/chunk.cfm @@ -0,0 +1,113 @@ + + + + + +OK + + + + + + + + + + + + + + + INSERT INTO upload_chunks (upload_id, chunk_index, total_chunks, filename, data, contract_id) + VALUES ( + , + , + , + , + , + + ) + + + + + + + + + + + SELECT chunk_index, data, filename, total_chunks, contract_id + FROM upload_chunks + WHERE upload_id = + ORDER BY chunk_index + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO documents (filename, mime_type, original_bytes, status) + VALUES (,,,'uploaded') + + + SELECT id FROM documents WHERE filename= AND status='uploaded' ORDER BY created_at DESC LIMIT 1 + + + + + + INSERT INTO contracts (number, client) VALUES (,'') + + + SELECT id FROM contracts ORDER BY created_at DESC LIMIT 1 + + + + + + INSERT INTO supplements (contract_id, document_id, type) VALUES (,,) + + + + + DELETE FROM upload_chunks WHERE upload_id = + + + + + + + + + + + + + +#serializeJSON(result)# diff --git a/index.cfm b/index.cfm index 3c562bd..040407b 100644 --- a/index.cfm +++ b/index.cfm @@ -8,6 +8,7 @@ Сверка договоров +