Download file and display

This commit is contained in:
Eudes Inácio
2022-01-07 16:01:17 +01:00
parent 08306ef215
commit b53b8abcdb
3 changed files with 44 additions and 28 deletions
+8 -3
View File
@@ -59,6 +59,8 @@ export class FileService {
uploadFile(formData:any){
console.log('UPLOAD file', formData)
//const geturl = environment.apiURL + 'Tasks/DelegateTask';
const geturl = environment.apiURL + 'ObjectServer/UploadFiles';
@@ -253,7 +255,7 @@ export class FileService {
this.capturedImageTitle = new Date().getTime() + '.jpeg';
const formData = new FormData();
formData.append("blobFile", this.capturedImage);
let guid: any = await this.uploadFile(formData).toPromise()
let guid: any = await this.uploadFile(this.capturedImage).toPromise()
console.log(guid.path);
let body = {
@@ -355,6 +357,8 @@ export class FileService {
addPictureToChat(roomId) {
console.log('add picture to chat')
const input = this.fileLoaderService.createInput({
accept: ['image/apng', 'image/jpeg', 'image/png']
})
@@ -377,7 +381,7 @@ export class FileService {
const formData = new FormData();
formData.append("blobFile", file);
let guid: any = await this.uploadFile(formData).toPromise()
console.log(guid.path);
console.log('add picture to chat',guid.path);
/* const imageData = await this.fileToBase64Service.convert(file)
this.capturedImage = imageData; */
@@ -407,8 +411,9 @@ export class FileService {
this.chatService.sendMessage(body).subscribe(res=> {
//console.log(res);
console.log('Msg after send image',res);
},(error) => {
console.log('Msg after send image error',error);
});
//console.log(this.capturedImage)
};