mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Download file and display
This commit is contained in:
@@ -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)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user