Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ import TooltipWrapper from "../../../../Common/TooltipWrapper/TooltipWrapper";
import ListObjectsTable from "./ListObjectsTable";
import FilterObjectsSB from "../../../../ObjectBrowser/FilterObjectsSB";
import AddAccessRule from "../../../BucketDetails/AddAccessRule";
import { sanitizeFilePath } from "./utils";

const DeleteMultipleObjects = withSuspense(
React.lazy(() => import("./DeleteMultipleObjects")),
Expand Down Expand Up @@ -506,7 +507,7 @@ const ListObjects = () => {

const blobFile = new Blob([file], { type: file.type });

const filePath = get(file, "path", "");
const filePath = sanitizeFilePath(get(file, "path", ""));
const fileWebkitRelativePath = get(file, "webkitRelativePath", "");

let relativeFolderPath = folderPath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,8 @@ export const displayFileIconName = (

return <IconWithLabel icon={icon} strings={splitItem} />;
};

export const sanitizeFilePath = (filePath: string) => {
// Replace `./` at the start of the path or preceded by `/` - happens when drag drop upload of files (not folders !) in chrome
return filePath.replace(/(^|\/)\.\//g, "/");
};
Loading