diff --git a/build-plugin.sh b/build-plugin.sh index 8eb7a79..441e3fe 100755 --- a/build-plugin.sh +++ b/build-plugin.sh @@ -2,7 +2,7 @@ set -eu PLUGIN="u-navigator" -VERSION="2026.06.23.r044" +VERSION="2026.06.23.r045" PKG_DIR="packages" WORK_DIR=".plugin-build" PKG_NAME="${PLUGIN}-${VERSION}.tgz" diff --git a/packages/u-navigator-2026.06.23.r044.tgz b/packages/u-navigator-2026.06.23.r044.tgz deleted file mode 100644 index f725761..0000000 Binary files a/packages/u-navigator-2026.06.23.r044.tgz and /dev/null differ diff --git a/packages/u-navigator-2026.06.23.r045.tgz b/packages/u-navigator-2026.06.23.r045.tgz new file mode 100644 index 0000000..0067e32 Binary files /dev/null and b/packages/u-navigator-2026.06.23.r045.tgz differ diff --git a/plugin-root/usr/local/emhttp/plugins/u-navigator/api/upload.php b/plugin-root/usr/local/emhttp/plugins/u-navigator/api/upload.php index cb6ae33..5001cbb 100644 --- a/plugin-root/usr/local/emhttp/plugins/u-navigator/api/upload.php +++ b/plugin-root/usr/local/emhttp/plugins/u-navigator/api/upload.php @@ -11,7 +11,7 @@ $uploaded = []; $names = unav_upload_array($_FILES['files']['name'] ?? []); $errors = unav_upload_array($_FILES['files']['error'] ?? []); $tmpNames = unav_upload_array($_FILES['files']['tmp_name'] ?? []); -$relativePaths = unav_upload_array($_POST['paths'] ?? []); +$relativePaths = unav_upload_array($_POST['paths'] ?? ($_POST['relativePath'] ?? [])); foreach ($names as $index => $name) { if (($errors[$index] ?? UPLOAD_ERR_NO_FILE) !== UPLOAD_ERR_OK) { unav_error(400, 'Upload failed'); diff --git a/server/public/app.js b/server/public/app.js index 1762d6b..01deee2 100644 --- a/server/public/app.js +++ b/server/public/app.js @@ -901,17 +901,19 @@ async function uploadFileList(win, files, targetPath) { return; } if (!files.length) return; - const form = new FormData(); const uploadItems = normalizeUploadItems(files); - for (const item of uploadItems) { - form.append('files[]', item.file, item.file.name); - form.append('paths[]', item.path); + for (const [index, item] of uploadItems.entries()) { + recordDebug('upload.file.request', { path: item.path, size: item.file.size, index: index + 1, total: uploadItems.length }); + const form = new FormData(); + form.append('files', item.file, item.file.name); + form.append('relativePath', item.path); + appendCsrf(form); + await fetchChecked(apiUrl(`upload.php?path=${encodeURIComponent(targetPath)}`), { + method: 'POST', + body: form + }); + recordDebug('upload.file.done', { path: item.path, index: index + 1, total: uploadItems.length }); } - appendCsrf(form); - await fetchChecked(apiUrl(`upload.php?path=${encodeURIComponent(targetPath)}`), { - method: 'POST', - body: form - }); await loadExplorer(win, targetPath); } diff --git a/u-navigator.plg b/u-navigator.plg index 725abc7..aa0e035 100644 --- a/u-navigator.plg +++ b/u-navigator.plg @@ -1,7 +1,7 @@ - + @@ -24,7 +24,7 @@ https://git.casaderoll.de/michael/Unraid-Navigator/raw/branch/main/packages/&package; -3d681de8838b4c51cbade67d1ad0cb57 +cd3b5a92d7174924985b5d929cb180fe