fix (upload): window only issue

There is a weird window only issue: https://learn.microsoft.com/en-us/windows/win32/fileio/
maximum-file-path-limitation?tabs=registry limiting path to 260
characters that is blocking the getMetadata function from resolving
This commit is contained in:
MickaelK 2025-09-24 11:14:11 +10:00
parent b9f2ee959d
commit b9104626fc

View file

@ -614,10 +614,11 @@ async function processItems(itemList) {
if (entry === null) continue; if (entry === null) continue;
else if (entry.isFile) { else if (entry.isFile) {
const entrySize = await new Promise((resolve) => { const entrySize = await new Promise((resolve) => {
if (typeof entry.getMetadata === "function") { if (typeof entry.getMetadata !== "function") return resolve(-1); // eg: firefox
entry.getMetadata(({ size }) => resolve(size)); entry.getMetadata(
} ({ size }) => resolve(size),
else resolve(null); // eg: firefox (err) => resolve(-1),
);
}); });
task = { task = {
type: "file", type: "file",