@@ -14,7 +14,7 @@ import { generateUrl } from '@nextcloud/router'
1414import { isPublicShare } from '@nextcloud/sharing/public'
1515import { getConflicts , getUploader } from '@nextcloud/upload'
1616import { vOnClickOutside } from '@vueuse/components'
17- import { extname } from 'path'
17+ import { extname , relative } from 'path'
1818import Vue , { computed , defineComponent } from 'vue'
1919import { action as sidebarAction } from '../actions/sidebarAction.ts'
2020import { onDropInternalFiles } from '../services/DropService.ts'
@@ -488,12 +488,17 @@ export default defineComponent({
488488 const items = Array . from ( event . dataTransfer ?. items || [ ] )
489489
490490 if ( selection . length === 0 && items . some ( ( item ) => item . kind === 'file' ) ) {
491+ const files = items . filter ( ( item ) => item . kind === 'file' )
492+ . map ( ( item ) => 'webkitGetAsEntry' in item ? item . webkitGetAsEntry ( ) : item . getAsFile ( ) )
493+ . filter ( Boolean ) as ( FileSystemEntry | File ) [ ]
491494 const uploader = getUploader ( )
495+ const root = uploader . destination . path
496+ const relativePath = relative ( root , this . source . path )
497+ logger . debug ( 'Start uploading dropped files' , { target : this . source . path , root, relativePath, files : files . map ( ( file ) => file . name ) } )
498+
492499 await uploader . batchUpload (
493- this . source . path ,
494- items . filter ( ( item ) => item . kind === 'file' )
495- . map ( ( item ) => 'webkitGetAsEntry' in item ? item . webkitGetAsEntry ( ) : item . getAsFile ( ) )
496- . filter ( Boolean ) as ( FileSystemEntry | File ) [ ] ,
500+ relativePath ,
501+ files ,
497502 async ( nodes , path ) => {
498503 try {
499504 const { contents, folder } = await this . activeView ! . getContents ( path )
@@ -536,7 +541,7 @@ export default defineComponent({
536541 const isCopy = event . ctrlKey
537542 this . dragover = false
538543
539- logger . debug ( 'Dropped' , { event, folder : this . source , selection, fileTree } )
544+ logger . debug ( 'Dropped' , { event, folder : this . source , selection } )
540545
541546 const nodes = selection . map ( ( source ) => this . filesStore . getNode ( source ) ) as Node [ ]
542547 await onDropInternalFiles ( nodes , this . source , contents , isCopy )
0 commit comments