0
votes

I am using as below:

<a [href]="pdfSrc" target="_blank" download="pdfName">Download</a>

whereas pdfSrc is coming from API response and it is a minio link. If I use sample .pdf file target="_blank" is opening, but when I use minio link it is opening the pdf in the current tab.

I want to open minio link pdf in a new tab, I am unable to do it with minio link.

If I use sample '.pdf' file target="_blank" is opening, but when I use minio link it is opening the pdf in the current tab.

I want to open minio link pdf in a new tab, I am unable to do it with minio link.

1
can you share sample minio link here - jitender
@jitender It is with VPN so you cannot connect with it - Mayuri More
If anybody can help me with any other method to download this minio link pdf directly or by opening it in new tab - Mayuri More
It's not to connect with it, it's just to see how your URL looks. It would be helpful if you could provide a sample URL for your minio link - nash11

1 Answers

1
votes

Try creating a method in component to open pdf in new window somthing like

pdfSrc='http://www.africau.edu/images/default/sample.pdf';

 download(){
    var redirectWindow = window.open(this.pdfSrc, '_blank');
    redirectWindow.location;
 }

And then call this method on href click

<a (click)="download()" download="pdfName">Download</a>

Stackbliz demo