A
A
Andrew2019-06-05 15:55:26
JavaScript
Andrew, 2019-06-05 15:55:26

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

Good afternoon! Please tell me how you can download the file if it comes as a link from another resource.
{url: http://somedomain.com/name.pdf}
In this case, it simply opens in a new window.
The question is, is this possible? If not, in what format should this file be received so that it can be downloaded?
file format - pdf.
I will be grateful for help)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Shohruh Shaimardonov, 2019-06-05
@joeberetta

Add an attribute to your link to download the file.
Like this:

<a href="http://somedomain.com/name.pdf" download>Скачать файл</a>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question