Following is my Response header for POSTMAN request:
Content-Disposition: attachment; filename="file_name.docx.docx"
where file_name
is the actual file name
Now, while downloading the file in Angular, I want this exact name. But instead of that, every time I download the file it picks up some random name
Following is my angular code:
this.http.get("url", {responseType: 'blob'}).subscribe((res) => {
const blob = new Blob([res], {type: 'application/msword'});
const url = window.URL.createObjectURL(blob);
window.open(url);
})
Is there any I can get the exact name of the file which we want to download, i.e. the same name which I am getting in Postman request header