@@ -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'
@@ -433,12 +434,17 @@ export default defineComponent({
433434 const items = Array . from ( event . dataTransfer ?. items || [ ] )
434435
435436 if ( selection . length === 0 && items . some ( ( item ) => item . kind === 'file' ) ) {
437+ const files = items . filter ( ( item ) => item . kind === 'file' )
438+ . map ( ( item ) => 'webkitGetAsEntry' in item ? item . webkitGetAsEntry ( ) : item . getAsFile ( ) )
439+ . filter ( Boolean ) as ( FileSystemEntry | File ) [ ]
436440 const uploader = getUploader ( )
441+ const root = uploader . destination . path
442+ const relativePath = relative ( root , this . source . path )
443+ logger . debug ( 'Start uploading dropped files' , { target : this . source . path , root, relativePath, files : files . map ( ( file ) => file . name ) } )
444+
437445 await uploader . batchUpload (
438- this . source . path ,
439- items . filter ( ( item ) => item . kind === 'file' )
440- . map ( ( item ) => 'webkitGetAsEntry' in item ? item . webkitGetAsEntry ( ) : item . getAsFile ( ) )
441- . filter ( Boolean ) as ( FileSystemEntry | File ) [ ] ,
446+ relativePath ,
447+ files ,
442448 async ( nodes , path ) => {
443449 try {
444450 const { contents, folder } = await this . activeView ! . getContents ( path )
@@ -481,7 +487,7 @@ export default defineComponent({
481487 const isCopy = event . ctrlKey
482488 this . dragover = false
483489
484- logger . debug ( 'Dropped' , { event, folder : this . source , selection, fileTree } )
490+ logger . debug ( 'Dropped' , { event, folder : this . source , selection } )
485491
486492 const nodes = selection . map ( ( source ) => this . filesStore . getNode ( source ) ) as Node [ ]
487493 await onDropInternalFiles ( nodes , this . source , contents , isCopy )
0 commit comments