mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
improve chat
This commit is contained in:
@@ -20,6 +20,47 @@ export class AttachmentsService {
|
||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
}
|
||||
|
||||
uploadFile(formData:any) {
|
||||
|
||||
console.log('UPLOAD file', formData)
|
||||
|
||||
//const geturl = environment.apiURL + 'Tasks/DelegateTask';
|
||||
const geturl = environment.apiURL + 'ObjectServer/UploadFiles';
|
||||
|
||||
let options = {
|
||||
headers: this.headers
|
||||
};
|
||||
|
||||
return this.http.post(`${geturl}`, formData, options);
|
||||
}
|
||||
|
||||
getFile(guid:any) {
|
||||
const geturl = environment.apiURL + 'lakefs/StreamFile';
|
||||
let params = new HttpParams();
|
||||
|
||||
params = params.set("path", guid);
|
||||
|
||||
this.headers = this.headers.set('responseType', 'blob');
|
||||
this.headers = this.headers.set('Content-Type', 'application/octet-stream');
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
return this.http.get<any>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
downloadFile(guid:any) {
|
||||
|
||||
let downloadUrl = environment.apiURL +'objectserver/streamfiles?path='+guid;
|
||||
var name = new Date().getTime();
|
||||
return this.http.get(downloadUrl, {
|
||||
responseType: "arraybuffer",
|
||||
reportProgress: true, observe: 'events'
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
getAttachmentsBySerial(serialNumber: string): Observable<Attachment[]>{
|
||||
let geturl = environment.apiURL + 'attachments/GetAttachments';
|
||||
let params = new HttpParams();
|
||||
|
||||
Reference in New Issue
Block a user