diff --git a/src/components/FileBrowser.jsx b/src/components/FileBrowser.jsx index aa99ea5..45aa475 100644 --- a/src/components/FileBrowser.jsx +++ b/src/components/FileBrowser.jsx @@ -214,8 +214,8 @@ export default function FileBrowser({ initialPath = '/', rootPath = '/' }) { async function uploadOneFile(url, token, fbPath, file, retries = 3) { for (let attempt = 1; attempt <= retries; attempt++) { try { - const res = await fetch(`${url}/api/resources?source=srv&path=${encodeURIComponent(fbPath)}&override=true`, { - method: 'POST', headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/octet-stream' }, body: file, + const res = await fetch(`${url}/api/resources?source=srv&path=${encodeURIComponent(fbPath)}&override=true&auth=${encodeURIComponent(token)}`, { + method: 'POST', headers: { 'Content-Type': 'application/octet-stream' }, body: file, }); if (!res.ok) { const t = await res.text(); throw new Error(t || res.status); } return; @@ -258,7 +258,7 @@ export default function FileBrowser({ initialPath = '/', rootPath = '/' }) { for (let i = 1; i <= parts.length; i++) dirsNeeded.add(parts.slice(0, i).join('/')); } for (const dir of [...dirsNeeded].sort((a, b) => a.split('/').length - b.split('/').length)) { - await fetch(`${url}/api/resources?source=srv&path=${encodeURIComponent(joinVirtualPath(fbPath, dir))}&isDir=true`, { method: 'POST', headers: { Authorization: `Bearer ${token}` } }).catch(() => {}); + await fetch(`${url}/api/resources?source=srv&path=${encodeURIComponent(joinVirtualPath(fbPath, dir))}&isDir=true&auth=${encodeURIComponent(token)}`, { method: 'POST' }).catch(() => {}); } for (let i = 0; i < sel.length; i++) { await uploadOneFile(url, token, joinVirtualPath(fbPath, sel[i].webkitRelativePath), sel[i]);