I've seen this question How can I create download link in html?. One solution to create a link for download is using this <a href="link/to/your/download/file" download="filename">Download link</a>
. However, if the data source is mongodb, what href
should be set?
Asked
Active
Viewed 654 times
0

Community
- 1
- 1

Coding_Rabbit
- 1,287
- 3
- 22
- 44
1 Answers
0
You have to give the path of the file where it's available in the database. Let's say your file is http://www.w3schools.com/images/myw3schoolsimage.jpg so in the response where you have to return the location you can put
<a href="http://www.w3schools.com/images/myw3schoolsimage.jpg" download>
[<img border="0" src="https://i.stack.imgur.com/S7CZv.jpg" alt="W3Schools" width="104" height="142">][1]

tripleee
- 175,061
- 34
- 275
- 318

Gayathri Mohan
- 2,924
- 4
- 19
- 25
-
What if the data source is my mongodb? – Coding_Rabbit Jun 08 '16 at 07:01