|
|
|
@ -7,6 +7,7 @@ import { of } from 'rxjs/observable/of';
|
|
|
|
|
import {Http} from "@angular/http";
|
|
|
|
|
import {Form} from "@angular/forms";
|
|
|
|
|
import * as formData from 'form-data';
|
|
|
|
|
import {forEach} from '@angular/router/src/utils/collection';
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-book',
|
|
|
|
@ -29,6 +30,7 @@ export class BookComponent implements OnInit, OnDestroy {
|
|
|
|
|
this.isClickCreateFolder = false;
|
|
|
|
|
this.fileChooseName = 'None';
|
|
|
|
|
this.filesToUpload = [];
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
@ -75,9 +77,27 @@ export class BookComponent implements OnInit, OnDestroy {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getfiles() {
|
|
|
|
|
//var preview = document.querySelector('img');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.http.post('/api/getFileList', {mainPath : this.mainFolder.path, owner: this.currentUser.username.toString()}).subscribe(files => {
|
|
|
|
|
if (files) {
|
|
|
|
|
this.allUserFile = files;
|
|
|
|
|
/*
|
|
|
|
|
for (let f of this.allUserFile) {
|
|
|
|
|
console.log('f.extention : ' + f.extention);
|
|
|
|
|
if (f.extention === ('text/plain')) {
|
|
|
|
|
this.reader = new FileReader();
|
|
|
|
|
let contenido;
|
|
|
|
|
console.log('ffff : ' + JSON.stringify(f));
|
|
|
|
|
this.reader.onload = (e) => {
|
|
|
|
|
contenido = this.reader.result;
|
|
|
|
|
console.log('contenido : ' + contenido);
|
|
|
|
|
};
|
|
|
|
|
this.reader.readAsText(f);
|
|
|
|
|
}
|
|
|
|
|
} */
|
|
|
|
|
} else {
|
|
|
|
|
this.allUserFile = [];
|
|
|
|
|
}
|
|
|
|
|