mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
try to solved add file
This commit is contained in:
@@ -824,17 +824,23 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
const roomId = this.roomId
|
||||
|
||||
const file: any = await this.fileService.getFileFromDevice(types);
|
||||
console.log(file)
|
||||
|
||||
|
||||
|
||||
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
|
||||
console.log(file.type)
|
||||
|
||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => {
|
||||
console.error(error);
|
||||
})));
|
||||
console.log(encodedData)
|
||||
const blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||
|
||||
console.log(blob
|
||||
)
|
||||
const fileBase64 = await this._getBase64(file)
|
||||
console.log(fileBase64)
|
||||
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('blobFile', blob);
|
||||
|
||||
Reference in New Issue
Block a user