fix: chunked base64 encoding to avoid JS argument overflow — v1.2
Deploy contracts-flask / validate (push) Successful in 0s
Deploy contracts-flask / validate (push) Successful in 0s
This commit is contained in:
@@ -64,7 +64,7 @@
|
||||
<a href="/">Сверка договоров</a>
|
||||
<span class="sep">|</span>
|
||||
<strong>DrHider</strong>
|
||||
<span style="font-size:11px;color:var(--muted);">v1.1</span>
|
||||
<span style="font-size:11px;color:var(--muted);">v1.2</span>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
@@ -126,7 +126,12 @@ BTN.onclick = async () => {
|
||||
const payload = [];
|
||||
for (const f of files) {
|
||||
const buf = await f.arrayBuffer();
|
||||
const b64 = btoa(String.fromCharCode(...new Uint8Array(buf)));
|
||||
const bytes = new Uint8Array(buf);
|
||||
let b64 = '';
|
||||
for (let i = 0; i < bytes.length; i += 8192) {
|
||||
b64 += String.fromCharCode.apply(null, bytes.slice(i, i + 8192));
|
||||
}
|
||||
b64 = btoa(b64);
|
||||
payload.push({name: f.name, data: b64, type: f.type || ''});
|
||||
}
|
||||
setStatus('progress', '⏳ Обработка... 0с');
|
||||
|
||||
Reference in New Issue
Block a user