#122 Print basic file info

This commit is contained in:
mauriziovitale84 2016-06-01 10:59:06 +01:00
parent cf4c611695
commit 97e8195d52

View File

@ -117,6 +117,7 @@ export class UploadButtonComponent {
*/
onFilesAdded($event: any): void {
let files = $event.currentTarget.files;
this.printFileInfo(files);
this.uploadFiles(this.uploaddirectory, files);
}
@ -127,6 +128,7 @@ export class UploadButtonComponent {
*/
onDirectoryAdded($event: any): void {
let files = $event.currentTarget.files;
this.printFileInfo(files);
let hashMapDir = this.convertIntoHashMap(files);
hashMapDir.forEach((filesDir, directoryPath) => {
@ -259,4 +261,16 @@ export class UploadButtonComponent {
private getContainerId(): string {
return this.currentFolderPath.replace('/Sites/', '').split('/')[1];
}
/**
* Prints the basic information of a file
* @param files
*/
printFileInfo(files: any) {
for (let file of files) {
console.log('Name: ' + file.name);
console.log('Size: ' + file.size);
console.log('Path: ' + file.webkitRelativePath);
}
}
}