Skip to content

Commit 63e2b46

Browse files
committed
Only adding a slash to destUri if folderName does not already have it
This should fix SolidOS/solid-panes#143
1 parent ef2fd6d commit 63e2b46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/widgets/dragAndDrop.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ function uploadFiles (fetcher, files, fileBase, imageBase, successHandler) {
195195
}
196196
}
197197
var folderName = theFile.type.startsWith('image/') ? imageBase || fileBase : fileBase
198-
var destURI = folderName + '/' + encodeURIComponent(theFile.name) + suffix
198+
var destURI = folderName + (folderName.endsWith('/') ? '' : '/') + encodeURIComponent(theFile.name) + suffix
199199

200200
fetcher.webOperation('PUT', destURI, { data: data, contentType: contentType })
201201
.then(response => {

0 commit comments

Comments
 (0)