diff --git a/deploy/files.js b/deploy/files.js index 79b14e3..7da51bd 100644 --- a/deploy/files.js +++ b/deploy/files.js @@ -312,7 +312,7 @@ async function addZipFile(file) { render(state); try { - // Отправить ZIP на бэкенд + // Отправить ZIP на бэкенд (multipart — бэкенд ищет boundary + PK magic) var zipResp = await new Promise(function(resolve, reject) { var xhr = new XMLHttpRequest(); xhr.open('POST', UNZIP_URL); @@ -321,7 +321,9 @@ async function addZipFile(file) { xhr.onerror = function() { reject(new Error('Сеть')); }; xhr.ontimeout = function() { reject(new Error('Таймаут')); }; xhr.timeout = 60000; - xhr.send(file); + var fd = new FormData(); + fd.append('files', file); + xhr.send(fd); }); if (!zipResp.ok || !zipResp.files) throw new Error('unzip failed');