I have an API which allows me to download .pptx file. So, I am writing a Http get request with content type application/vnd.openxmlformats-officedocument.presentationml.presentation
and response type- text.
However I am getting an error for JSON.parse()
--- So, not able to download file.
Below is the code for reference:
service.ts:
getPPTs(){
const httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
responseType : 'text',
Accept : 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
observe : 'response'
})
};
return this.http.get(environment.resourceUrl, httpOptions);
}
Also, I want to display .pptx
file content in modal pop-up.
Can anybody suggest any solution?