Skip to content
Snippets Groups Projects
Commit 4d302a2b authored by Oussama's avatar Oussama
Browse files

change the name of ua downloaded file

parent 6d1f1a73
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,6 @@ export class ArchivePreviewComponent implements OnInit {
}
ngOnInit() {
}
......@@ -40,7 +39,7 @@ export class ArchivePreviewComponent implements OnInit {
let headers = new HttpHeaders().append('Content-Type', 'application/json');
headers = headers.append('X-Access-Contract-Id', this.accessContract);
return this.archiveService.downloadObjectFromUnit(archiveUnit['#id'], headers);
return this.archiveService.downloadObjectFromUnit(archiveUnit['#id'], archiveUnit.Title, headers);
}
emitClose() {
......
......@@ -153,7 +153,7 @@ export class ArchiveService extends SearchService<any> {
return pagedResult;
}
downloadObjectFromUnit(id : string , headers?: HttpHeaders) {
downloadObjectFromUnit(id : string , name : string, headers?: HttpHeaders) {
return this.archiveApiService.downloadObjectFromUnit(id, headers).subscribe(
......@@ -161,7 +161,7 @@ export class ArchiveService extends SearchService<any> {
const element = document.createElement('a');
element.href = window.URL.createObjectURL(file);
element.download ='item-'+id;
element.download =name;
element.style.visibility = 'hidden';
document.body.appendChild(element);
element.click();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment