<input type="file" webkitdirectory/>
// Drop listener @HostListener('drop', ['$event']) public ondrop(evt) { evt.preventDefault(); evt.stopPropagation(); const items = evt.dataTransfer.items; for (let i = 0; i < items.length; i++) { const item = items[i].webkitGetAsEntry(); if (item) { this.traverseFileTree(item); } } } traverseFileTree(item, path?) { path = path || ''; if (item.isFile) { item.file((file) => { this.myFiles.push(file); }); } else if (item.isDirectory) { const dirReader = item.createReader(); dirReader.readEntries((entries) => { console.log('file count: ' + entries.length); for (let i = 0; i < entries.length; i++) { console.log('file path: ' + entries[i].fullPath); this.traverseFileTree(entries[i], path + item.name + '/'); } }); } uploadDirectoryPath() { const frmData = new FormData(); for (let i = 0; i < this.myFiles.length; i++){ frmData.append('file', this.myFiles[i]); } this.http.post('http://zld06464.vci.att.com/tuvservice/upload/file', frmData).subscribe( data => { this.sMsg = data as string; console.log (this.sMsg); }, (err: HttpErrorResponse) => { console.log (err.message); } ); } -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/angular/3b612977-d32f-44ce-bc12-2581418b6556%40googlegroups.com.