Upload dropped folders file by file
This commit is contained in:
+1
-1
@@ -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"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -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');
|
||||
|
||||
@@ -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 });
|
||||
}
|
||||
await loadExplorer(win, targetPath);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE PLUGIN [
|
||||
<!ENTITY name "u-navigator">
|
||||
<!ENTITY author "Michael Roll">
|
||||
<!ENTITY version "2026.06.23.r044">
|
||||
<!ENTITY version "2026.06.23.r045">
|
||||
<!ENTITY package "&name;-&version;.tgz">
|
||||
<!ENTITY pluginURL "https://git.casaderoll.de/michael/Unraid-Navigator/raw/branch/main/u-navigator.plg">
|
||||
<!ENTITY support "https://git.casaderoll.de/michael/Unraid-Navigator">
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
<FILE Name="/boot/config/plugins/&name;/&package;">
|
||||
<URL>https://git.casaderoll.de/michael/Unraid-Navigator/raw/branch/main/packages/&package;</URL>
|
||||
<MD5>3d681de8838b4c51cbade67d1ad0cb57</MD5>
|
||||
<MD5>cd3b5a92d7174924985b5d929cb180fe</MD5>
|
||||
</FILE>
|
||||
|
||||
<FILE Run="/bin/bash">
|
||||
|
||||
Reference in New Issue
Block a user