How to download the file if it comes as a link from another resource?

Good day! Please tell me how to download the file if it comes as a link from another resource.
{url: http://somedomain.com/name.pdf}
In this case, it just opens in a new window.

The question is, is it possible? If not - in what format we need to get this file to be able to download it?
file format - PDF.

I would be grateful for help)
March 23rd 20 at 19:12
1 answer
March 23rd 20 at 19:14
Add your link attribute to the downloaded file.
Here it is:
<a href="http://somedomain.com/name.pdf" download>Download file</a>
not working - Bernie_Kie commented on March 23rd 20 at 19:17
@Bernie_KieWhich browser, FF? - major.Jacobson11 commented on March 23rd 20 at 19:20
@Bernie_Kie, understand your problem. This is because browsers have a built-in pdf viewer. If possible, download the file in a different format and you will have and without download automatically download - derrick_Kertzmann commented on March 23rd 20 at 19:23
@major.Jacobson11chrome
@derrick_Kertzmann, need it pdf.
I think the question here is bezopasnosti, the browser will not allow you to download the file - Bernie_Kie commented on March 23rd 20 at 19:26
@Bernie_Kie, Yes. It is just the same will. Here the problem is that chrome have long included pdf viewer in itself, and now when opening pdf even link it to the user once again not looking for a file it automatically shows. And then, if necessary, the user can tap the button download and out swing - derrick_Kertzmann commented on March 23rd 20 at 19:29
@derrick_Kertzmann, then why it downloads when otnositelno way ?
'/some-name.pdf' - Bernie_Kie commented on March 23rd 20 at 19:32
@Bernie_Kie, this is a good question. This is not understood - derrick_Kertzmann commented on March 23rd 20 at 19:35

Find more questions by tags BrowsersHTMLJavaScript