upload() {
const description = this.photoForm.get('description').value;
const allowComments = this.photoForm.get('allowComments').value;
this.photoService
.upload(description, allowComments, this.file)
.subscribe(() => this.router.navigate(['']))
}
handlefile(file:File){
this.file = file;
const reader = new FileReader();
reader.onload = (event : any) => this.preview = event.target.result;
reader.readAsDataURL(file);
}