@@ -14,6 +14,7 @@ import { isPublicShare } from '@nextcloud/sharing/public'
1414import { generateUrl } from '@nextcloud/router'
1515import { getConflicts , getUploader } from '@nextcloud/upload'
1616import { vOnClickOutside } from '@vueuse/components'
17+ import { relative } from 'path'
1718import Vue , { computed , defineComponent } from 'vue'
1819
1920import { action as sidebarAction } from '../actions/sidebarAction.ts'
@@ -471,12 +472,17 @@ export default defineComponent({
471472 const items = Array . from ( event . dataTransfer ?. items || [ ] )
472473
473474 if ( selection . length === 0 && items . some ( ( item ) => item . kind === 'file' ) ) {
475+ const files = items . filter ( ( item ) => item . kind === 'file' )
476+ . map ( ( item ) => 'webkitGetAsEntry' in item ? item . webkitGetAsEntry ( ) : item . getAsFile ( ) )
477+ . filter ( Boolean ) as ( FileSystemEntry | File ) [ ]
474478 const uploader = getUploader ( )
479+ const root = uploader . destination . path
480+ const relativePath = relative ( root , this . source . path )
481+ logger . debug ( 'Start uploading dropped files' , { target : this . source . path , root, relativePath, files : files . map ( ( file ) => file . name ) } )
482+
475483 await uploader . batchUpload (
476- this . source . path ,
477- items . filter ( ( item ) => item . kind === 'file' )
478- . map ( ( item ) => 'webkitGetAsEntry' in item ? item . webkitGetAsEntry ( ) : item . getAsFile ( ) )
479- . filter ( Boolean ) as ( FileSystemEntry | File ) [ ] ,
484+ relativePath ,
485+ files ,
480486 async ( nodes , path ) => {
481487 try {
482488 const { contents, folder } = await this . activeView ! . getContents ( path )
@@ -519,7 +525,7 @@ export default defineComponent({
519525 const isCopy = event . ctrlKey
520526 this . dragover = false
521527
522- logger . debug ( 'Dropped' , { event, folder : this . source , selection, fileTree } )
528+ logger . debug ( 'Dropped' , { event, folder : this . source , selection } )
523529
524530 const nodes = selection . map ( ( source ) => this . filesStore . getNode ( source ) ) as Node [ ]
525531 await onDropInternalFiles ( nodes , this . source , contents , isCopy )
0 commit comments