File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
web-app/src/screens/Console/Buckets/ListBuckets/Objects/ListObjects Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ import TooltipWrapper from "../../../../Common/TooltipWrapper/TooltipWrapper";
122
122
import ListObjectsTable from "./ListObjectsTable" ;
123
123
import FilterObjectsSB from "../../../../ObjectBrowser/FilterObjectsSB" ;
124
124
import AddAccessRule from "../../../BucketDetails/AddAccessRule" ;
125
+ import { sanitizeFilePath } from "./utils" ;
125
126
126
127
const DeleteMultipleObjects = withSuspense (
127
128
React . lazy ( ( ) => import ( "./DeleteMultipleObjects" ) ) ,
@@ -506,7 +507,7 @@ const ListObjects = () => {
506
507
507
508
const blobFile = new Blob ( [ file ] , { type : file . type } ) ;
508
509
509
- const filePath = get ( file , "path" , "" ) ;
510
+ const filePath = sanitizeFilePath ( get ( file , "path" , "" ) ) ;
510
511
const fileWebkitRelativePath = get ( file , "webkitRelativePath" , "" ) ;
511
512
512
513
let relativeFolderPath = folderPath ;
Original file line number Diff line number Diff line change @@ -134,3 +134,8 @@ export const displayFileIconName = (
134
134
135
135
return < IconWithLabel icon = { icon } strings = { splitItem } /> ;
136
136
} ;
137
+
138
+ export const sanitizeFilePath = ( filePath : string ) => {
139
+ // Replace `./` at the start of the path or preceded by `/` - happens when drag drop upload of files (not folders !) in chrome
140
+ return filePath . replace ( / ( ^ | \/ ) \. \/ / g, "/" ) ;
141
+ } ;
You can’t perform that action at this time.
0 commit comments