diff --git a/web/apps/photos/src/components/Upload/Uploader.tsx b/web/apps/photos/src/components/Upload/Uploader.tsx index 0d310d7f9..cfd674e3f 100644 --- a/web/apps/photos/src/components/Upload/Uploader.tsx +++ b/web/apps/photos/src/components/Upload/Uploader.tsx @@ -324,10 +324,12 @@ export default function Uploader({ // Trigger an upload when any of the dependencies change. useEffect(() => { const allItemAndPaths = [ - // See: [Note: webkitRelativePath] + // See: [Note: webkitRelativePath]. In particular, they use POSIX + // separators. webFiles.map((f) => [f, f.webkitRelativePath ?? f.name]), desktopFiles.map((fp) => [fp, fp.path]), desktopFilePaths.map((p) => [p, p]), + // ze[1], the entry name, uses POSIX separators. desktopZipItems.map((ze) => [ze, ze[1]]), ].flat() as [UploadItem, string][]; diff --git a/web/packages/next/types/ipc.ts b/web/packages/next/types/ipc.ts index d5007ea80..c85106241 100644 --- a/web/packages/next/types/ipc.ts +++ b/web/packages/next/types/ipc.ts @@ -641,7 +641,7 @@ export interface FolderWatchSyncedFile { * > * > The path stored MUST NOT contain a drive or device letter, or a leading * > slash. All slashes MUST be forward slashes '/' as opposed to backwards - * > slashes '\' for compatibility with Amiga and UNIX file systems etc. If + * > slashes '\' for compatibility with Amiga and UNIX file systems etc. If * > input came from standard input, there is no file name field. * > * > https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT diff --git a/web/packages/shared/hooks/useFileInput.tsx b/web/packages/shared/hooks/useFileInput.tsx index ae1dfcab0..71f027cef 100644 --- a/web/packages/shared/hooks/useFileInput.tsx +++ b/web/packages/shared/hooks/useFileInput.tsx @@ -60,6 +60,10 @@ export default function useFileInput({ // containing the relative path to the selected directory. // // https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory + // + // These paths use the POSIX path separator ("/"). + // https://stackoverflow.com/questions/62806233/when-using-webkitrelativepath-is-the-path-separator-operating-system-specific + // const directoryOpts = directory ? { directory: "", webkitdirectory: "" } : {};